Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: tests/GrContextFactoryTest.cpp

Issue 13855007: Add --threads to tests binary, to run non-GPU tests on multiple cores. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: SkTScopedPtr -> SkAutoTDelete, and clean up merge conflicts with codereview.chromium.org/14002007 Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/Test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Test.h" 8 #include "Test.h"
9 9
10 // This is a GPU-backend specific test 10 // This is a GPU-backend specific test
11 #if SK_SUPPORT_GPU 11 #if SK_SUPPORT_GPU
12 #include "GrContextFactory.h" 12 #include "GrContextFactory.h"
13 13
14 static void test_context_factory(skiatest::Reporter* reporter) { 14 static void test_context_factory(skiatest::Reporter* reporter,
15 GrContextFactory contextFactory; 15 GrContextFactory* contextFactory) {
16 // Reset in case some other test has been using it first.
17 contextFactory->destroyContexts();
16 18
17 // Before we ask for a context, we expect the GL context to not be there. 19 // Before we ask for a context, we expect the GL context to not be there.
18 REPORTER_ASSERT(reporter, 20 REPORTER_ASSERT(reporter,
19 NULL == contextFactory.getGLContext(GrContextFactory::kNativ e_GLContextType)); 21 NULL == contextFactory->getGLContext(GrContextFactory::kNati ve_GLContextType));
20 22
21 // After we ask for a context, we expect that the GL context to be there. 23 // After we ask for a context, we expect that the GL context to be there.
22 contextFactory.get(GrContextFactory::kNative_GLContextType); 24 contextFactory->get(GrContextFactory::kNative_GLContextType);
23 REPORTER_ASSERT(reporter, 25 REPORTER_ASSERT(reporter,
24 contextFactory.getGLContext(GrContextFactory::kNative_GLCont extType) != NULL); 26 contextFactory->getGLContext(GrContextFactory::kNative_GLCon textType) != NULL);
25 27
26 // If we did not ask for a context with the particular GL context, we would 28 // If we did not ask for a context with the particular GL context, we would
27 // expect the particular GL context to not be there. 29 // expect the particular GL context to not be there.
28 REPORTER_ASSERT(reporter, 30 REPORTER_ASSERT(reporter,
29 NULL == contextFactory.getGLContext(GrContextFactory::kNull_ GLContextType)); 31 NULL == contextFactory->getGLContext(GrContextFactory::kNull _GLContextType));
30 } 32 }
31 33
32 34
33 #include "TestClassDef.h" 35 #include "TestClassDef.h"
34 DEFINE_TESTCLASS("GrContextFactory", GrContextFactoryClass, test_context_factory ); 36 DEFINE_GPUTESTCLASS("GrContextFactory", GrContextFactoryClass, test_context_fact ory);
35 37
36 #endif 38 #endif
OLDNEW
« no previous file with comments | « no previous file | tests/Test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698