summaryrefslogtreecommitdiffstats
path: root/components/test
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-07 14:08:44 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-07 14:08:44 +0000
commitd65d6fe3c667835a8a0ddc0b917519115321d605 (patch)
treeb0090c9cbf784c825eb554fcb869dd0bc363a9dd /components/test
parent520d01a2c42f41e8003bc409f4bf0dba0b45f835 (diff)
downloadchromium_src-d65d6fe3c667835a8a0ddc0b917519115321d605.zip
chromium_src-d65d6fe3c667835a8a0ddc0b917519115321d605.tar.gz
chromium_src-d65d6fe3c667835a8a0ddc0b917519115321d605.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, 266565 Review URL: https://codereview.chromium.org/22293003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/test')
-rw-r--r--components/test/run_all_unittests.cc4
1 files changed, 0 insertions, 4 deletions
diff --git a/components/test/run_all_unittests.cc b/components/test/run_all_unittests.cc
index 49032ba..a881798 100644
--- a/components/test/run_all_unittests.cc
+++ b/components/test/run_all_unittests.cc
@@ -6,7 +6,6 @@
#include "base/test/test_suite.h"
#include "content/public/test/test_content_client_initializer.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/compositor/compositor_setup.h"
namespace components {
@@ -34,9 +33,6 @@ class ComponentsUnitTestEventListener : public testing::EmptyTestEventListener {
int main(int argc, char** argv) {
base::TestSuite test_suite(argc, argv);
- // Mock out the compositor on platforms that use it.
- ui::SetupTestCompositor();
-
// The listener will set up common test environment for all components unit
// tests.
testing::TestEventListeners& listeners =