1cb93a386Sopenharmony_ci/* 2cb93a386Sopenharmony_ci * Copyright 2015 Google Inc. 3cb93a386Sopenharmony_ci * 4cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be 5cb93a386Sopenharmony_ci * found in the LICENSE file. 6cb93a386Sopenharmony_ci */ 7cb93a386Sopenharmony_ci 8cb93a386Sopenharmony_ci#include "tests/Test.h" 9cb93a386Sopenharmony_ci 10cb93a386Sopenharmony_ci#include "include/gpu/GrDirectContext.h" 11cb93a386Sopenharmony_ci#include "tools/gpu/gl/GLTestContext.h" 12cb93a386Sopenharmony_ci 13cb93a386Sopenharmony_ci// This is an example of a normal test. 14cb93a386Sopenharmony_ciDEF_TEST(TestNormal, reporter) { 15cb93a386Sopenharmony_ci REPORTER_ASSERT(reporter, reporter); 16cb93a386Sopenharmony_ci} 17cb93a386Sopenharmony_ci 18cb93a386Sopenharmony_ci// This is an example of a GPU test that uses GrContextOptions to do the test. 19cb93a386Sopenharmony_ciDEF_GPUTEST(TestGpuFactory, reporter, factory) { 20cb93a386Sopenharmony_ci REPORTER_ASSERT(reporter, reporter); 21cb93a386Sopenharmony_ci} 22cb93a386Sopenharmony_ci 23cb93a386Sopenharmony_ci// This is an example of a GPU test that tests a property that should work for all GPU contexts. 24cb93a386Sopenharmony_ci// Note: Some of the contexts might not produce a rendering output. 25cb93a386Sopenharmony_ciDEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuAllContexts, reporter, ctxInfo) { 26cb93a386Sopenharmony_ci REPORTER_ASSERT(reporter, reporter); 27cb93a386Sopenharmony_ci REPORTER_ASSERT(reporter, ctxInfo.directContext()); 28cb93a386Sopenharmony_ci} 29cb93a386Sopenharmony_ci 30cb93a386Sopenharmony_ci// This is an example of a GPU test that tests a property that should work for all GPU contexts that 31cb93a386Sopenharmony_ci// produce a rendering output. 32cb93a386Sopenharmony_ciDEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestGpuRenderingContexts, reporter, ctxInfo) { 33cb93a386Sopenharmony_ci REPORTER_ASSERT(reporter, reporter); 34cb93a386Sopenharmony_ci REPORTER_ASSERT(reporter, ctxInfo.directContext()); 35cb93a386Sopenharmony_ci} 36cb93a386Sopenharmony_ci 37cb93a386Sopenharmony_ci// This is an example of a GPU test that tests a property that uses the mock context. It should 38cb93a386Sopenharmony_ci// be used if the test tests some behavior that is mocked with the mock context. 39cb93a386Sopenharmony_ciDEF_GPUTEST_FOR_MOCK_CONTEXT(TestMockContext, reporter, ctxInfo) { 40cb93a386Sopenharmony_ci REPORTER_ASSERT(reporter, reporter); 41cb93a386Sopenharmony_ci REPORTER_ASSERT(reporter, ctxInfo.directContext()); 42cb93a386Sopenharmony_ci} 43