summaryrefslogtreecommitdiffstats
path: root/ash/test
diff options
context:
space:
mode:
authornhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-12 03:41:34 +0000
committernhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-12 03:41:34 +0000
commitdf2622c220bc254a8e65831d4096bb67f1ca27fa (patch)
tree5945afc270af83b3a6a6ca38a940263d9193f4bc /ash/test
parent5e580934d0a5ec616c6f0201cc1eab3a463e61b9 (diff)
downloadchromium_src-df2622c220bc254a8e65831d4096bb67f1ca27fa.zip
chromium_src-df2622c220bc254a8e65831d4096bb67f1ca27fa.tar.gz
chromium_src-df2622c220bc254a8e65831d4096bb67f1ca27fa.tar.bz2
Revert 216780 "Clean up compositor initialization/destruction."
> 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 > > Review URL: https://chromiumcodereview.appspot.com/22293003 TBR=danakj@chromium.org Review URL: https://codereview.chromium.org/22648006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216907 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test')
-rw-r--r--ash/test/test_shell_delegate.cc5
-rw-r--r--ash/test/test_suite.cc2
2 files changed, 2 insertions, 5 deletions
diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc
index f7b1eaa..9b51e6a 100644
--- a/ash/test/test_shell_delegate.cc
+++ b/ash/test/test_shell_delegate.cc
@@ -17,7 +17,6 @@
#include "base/logging.h"
#include "content/public/test/test_browser_context.h"
#include "ui/aura/window.h"
-#include "ui/compositor/compositor.h"
namespace ash {
namespace test {
@@ -204,10 +203,6 @@ double TestShellDelegate::GetSavedScreenMagnifierScale() {
}
RootWindowHostFactory* TestShellDelegate::CreateRootWindowHostFactory() {
- // The ContextFactory must exist before any Compositors are created.
- bool allow_test_contexts = true;
- ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts);
-
return RootWindowHostFactory::Create();
}
diff --git a/ash/test/test_suite.cc b/ash/test/test_suite.cc
index 54c24ee..02c5f29 100644
--- a/ash/test/test_suite.cc
+++ b/ash/test/test_suite.cc
@@ -12,6 +12,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
+#include "ui/compositor/compositor_setup.h"
#include "ui/gfx/gfx_paths.h"
#if defined(OS_MACOSX)
@@ -54,6 +55,7 @@ void AuraShellTestSuite::Initialize() {
// Force unittests to run using en-US so if we test against string
// output, it'll pass regardless of the system language.
ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
+ ui::SetupTestCompositor();
}
void AuraShellTestSuite::Shutdown() {