Index: content/public/test/test_renderer_host.cc |
diff --git a/content/public/test/test_renderer_host.cc b/content/public/test/test_renderer_host.cc |
index c837a76eda2dbce04b2aa7385514cf2cb5fa4848..2c13db47e886ee338ac35f12328170c16de182ce 100644 |
--- a/content/public/test/test_renderer_host.cc |
+++ b/content/public/test/test_renderer_host.cc |
@@ -24,6 +24,7 @@ |
#if defined(USE_AURA) |
#include "ui/aura/test/aura_test_helper.h" |
+#include "ui/compositor/test/context_factories_for_test.h" |
#endif |
namespace content { |
@@ -165,10 +166,13 @@ void RenderViewHostTestHarness::SetUp() { |
ole_initializer_.reset(new ui::ScopedOleInitializer()); |
#endif |
#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(base::MessageLoopForUI::current())); |
- bool allow_test_contexts = true; |
- aura_test_helper_->SetUp(allow_test_contexts); |
+ aura_test_helper_->SetUp(); |
#endif |
DCHECK(!browser_context_); |
@@ -181,6 +185,7 @@ void RenderViewHostTestHarness::TearDown() { |
SetContents(NULL); |
#if defined(USE_AURA) |
aura_test_helper_->TearDown(); |
+ ui::TerminateContextFactoryForTests(); |
#endif |
// Make sure that we flush any messages related to WebContentsImpl destruction |
// before we destroy the browser context. |