diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-12 20:58:01 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-12 20:58:01 +0000 |
commit | d56d3bb8a1050fba50f3b8713f50469dd6650a01 (patch) | |
tree | 077fa87ccbf7a66681161ff7c3a5f73903cd9fcc /content/browser/gpu/gpu_ipc_browsertests.cc | |
parent | a558f00b7ff7d2e9665fd16fe4bd24285a02dcb5 (diff) | |
download | chromium_src-d56d3bb8a1050fba50f3b8713f50469dd6650a01.zip chromium_src-d56d3bb8a1050fba50f3b8713f50469dd6650a01.tar.gz chromium_src-d56d3bb8a1050fba50f3b8713f50469dd6650a01.tar.bz2 |
Clean up compositor initialization/destruction.
Moved from https://codereview.chromium.org/21052007/
Currently the ContextFactory is outliving the compositor thread in
tests, which is bad since the contexts in there can be bound to the
compositor thread. Then we end up reusing those contexts and bad
things happen.
This enforces ordering for initializing and destroying the
compositor as follows:
Initialize ContextFactory
..Compositor::Initialize
....Create Compositor instances
....Delete Compositor instances
..Compositor::Terminate
The Compositor::Terminate call also destroys the ContextFactory.
The ContextFactory can be initialized in one of two ways:
1. ImageTransportFactory::Initialize will set up the
ContextFactory. This is used by things that invoke all of
content/browser/.
2. Compositor::InitializeContextFactoryForTests() must be
explicitly called by any unit tests that create a compositor.
Since some tests want a real GL context and some don't, this
does away with the misnomer of initializing the Compositor once
for the entire test suite, and then re-initializing somewhere
in the middle of the test suite. Instead, each test must
Initialize/Terminate the compositor with the ContextFactory
type of its choice.
Incidently, this test enables 20 tests on aura or win_aura that
were previously being skipped.
TBR=piman@chromium.org
BUG=258625
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=216780
Review URL: https://chromiumcodereview.appspot.com/22293003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217069 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu/gpu_ipc_browsertests.cc')
-rw-r--r-- | content/browser/gpu/gpu_ipc_browsertests.cc | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/content/browser/gpu/gpu_ipc_browsertests.cc b/content/browser/gpu/gpu_ipc_browsertests.cc index 7b7186c..0ee93db 100644 --- a/content/browser/gpu/gpu_ipc_browsertests.cc +++ b/content/browser/gpu/gpu_ipc_browsertests.cc @@ -26,18 +26,6 @@ class ContextTestBase : public content::ContentBrowserTest { ContentBrowserTest::SetUpOnMainThread(); } - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { - // TODO(Hubbe): This code is very similar to some code in - // test/gpu/gpu_feature_browsertest.cc, and should really be - // shared in a common location. - if (!command_line->HasSwitch(switches::kUseGpuInTests)) { - CHECK(!command_line->HasSwitch(switches::kUseGL)) - << "kUseGL must not be set by test framework code!"; - command_line->AppendSwitchASCII(switches::kUseGL, - gfx::kGLImplementationOSMesaName); - } - } - virtual void TearDownOnMainThread() OVERRIDE { // Must delete the context first. context_.reset(NULL); |