diff options
author | bsalomon <bsalomon@google.com> | 2016-04-05 12:59:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-05 12:59:06 -0700 |
commit | f2f1c17e331fe1e0ce695969970ecebc81e12ceb (patch) | |
tree | e4dc53ee03e1803307a43917fb440d19cfe3f6f1 /tests/TestTest.cpp | |
parent | 4319593988db5796023d9f5f34a8ed285c2097dd (diff) |
One signature for creating unit tests that run on premade GrContexts
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1860593002
Review URL: https://codereview.chromium.org/1860593002
Diffstat (limited to 'tests/TestTest.cpp')
-rw-r--r-- | tests/TestTest.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/tests/TestTest.cpp b/tests/TestTest.cpp index 66c9b2df5c..7443ffe325 100644 --- a/tests/TestTest.cpp +++ b/tests/TestTest.cpp @@ -29,36 +29,26 @@ DEF_GPUTEST(TestGpuFactory, reporter, factory) { // This is an example of a GPU test that tests a property that should work for all GPU contexts. // Note: Some of the contexts might not produce a rendering output. #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuAllContexts, reporter, context) { +DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuAllContexts, reporter, ctxInfo) { REPORTER_ASSERT(reporter, reporter); - REPORTER_ASSERT(reporter, context); + REPORTER_ASSERT(reporter, ctxInfo.fGrContext); } #endif // This is an example of a GPU test that tests a property that should work for all GPU contexts that // produce a rendering output. #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestGpuRenderingContexts, reporter, context) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestGpuRenderingContexts, reporter, ctxInfo) { REPORTER_ASSERT(reporter, reporter); - REPORTER_ASSERT(reporter, context); + REPORTER_ASSERT(reporter, ctxInfo.fGrContext); } #endif // This is an example of a GPU test that tests a property that uses the null GPU context. It should // be used if the test tests some behavior that is mocked with the null context. #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_NULL_CONTEXT(TestGpuNullContext, reporter, context) { +DEF_GPUTEST_FOR_NULL_CONTEXT(TestGpuNullContext, reporter, ctxInfo) { REPORTER_ASSERT(reporter, reporter); - REPORTER_ASSERT(reporter, context); -} -#endif - -// This is an example of a GPU test that tests a property that should work for all GPU contexts. -// It uses the additional GLTestContext* glContext to implement the test. -#if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuGrContextAndGLContext, reporter, context, glContext) { - REPORTER_ASSERT(reporter, reporter); - REPORTER_ASSERT(reporter, context); - REPORTER_ASSERT(reporter, glContext); + REPORTER_ASSERT(reporter, ctxInfo.fGrContext); } #endif |