Index: ui/views/test/views_test_base.cc |
diff --git a/ui/views/test/views_test_base.cc b/ui/views/test/views_test_base.cc |
index 37085e38acfd9413ff70475990da7a03873a261d..23539f7c639b0cec318a5cfc84171138d5a2951a 100644 |
--- a/ui/views/test/views_test_base.cc |
+++ b/ui/views/test/views_test_base.cc |
@@ -12,6 +12,7 @@ |
#include "ui/aura/env.h" |
#include "ui/aura/root_window.h" |
#include "ui/aura/test/aura_test_helper.h" |
+#include "ui/compositor/test/context_factories_for_test.h" |
#include "ui/views/corewm/capture_controller.h" |
#include "ui/views/corewm/wm_state.h" |
#endif |
@@ -36,9 +37,12 @@ void ViewsTestBase::SetUp() { |
if (!views_delegate_.get()) |
views_delegate_.reset(new TestViewsDelegate()); |
#if defined(USE_AURA) |
+ // The ContextFactory must exist before any Compositors are created. |
+ bool enable_pixel_output = false; |
+ ui::InitializeContextFactoryForTests(enable_pixel_output); |
+ |
aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); |
- bool allow_test_contexts = true; |
- aura_test_helper_->SetUp(allow_test_contexts); |
+ aura_test_helper_->SetUp(); |
wm_state_.reset(new views::corewm::WMState); |
#endif // USE_AURA |
ui::InitializeInputMethodForTesting(); |
@@ -56,6 +60,7 @@ void ViewsTestBase::TearDown() { |
ui::ShutdownInputMethodForTesting(); |
#if defined(USE_AURA) |
aura_test_helper_->TearDown(); |
+ ui::TerminateContextFactoryForTests(); |
wm_state_.reset(); |
CHECK(!corewm::ScopedCaptureClient::IsActive()); |
#endif // USE_AURA |