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