Index: chrome/test/base/browser_with_test_window_test.cc |
diff --git a/chrome/test/base/browser_with_test_window_test.cc b/chrome/test/base/browser_with_test_window_test.cc |
index 5d7cd98cc4d2149691e8360ff125694c5ee3e78b..06e33c02c7181b90910ddbbe50a7ef4105f3e6a6 100644 |
--- a/chrome/test/base/browser_with_test_window_test.cc |
+++ b/chrome/test/base/browser_with_test_window_test.cc |
@@ -19,6 +19,7 @@ |
#if defined(USE_AURA) |
#include "ui/aura/test/aura_test_helper.h" |
+#include "ui/compositor/compositor.h" |
#include "ui/compositor/test/context_factories_for_test.h" |
#include "ui/wm/core/default_activation_client.h" |
#endif |
@@ -68,15 +69,16 @@ void BrowserWithTestWindowTest::SetUp() { |
#elif defined(USE_AURA) |
// The ContextFactory must exist before any Compositors are created. |
bool enable_pixel_output = false; |
- ui::InitializeContextFactoryForTests(enable_pixel_output); |
+ ui::ContextFactory* context_factory = |
+ ui::InitializeContextFactoryForTests(enable_pixel_output); |
aura_test_helper_.reset(new aura::test::AuraTestHelper( |
base::MessageLoopForUI::current())); |
- aura_test_helper_->SetUp(); |
+ aura_test_helper_->SetUp(context_factory); |
new wm::DefaultActivationClient(aura_test_helper_->root_window()); |
#endif // USE_AURA |
#if !defined(OS_CHROMEOS) && defined(TOOLKIT_VIEWS) |
- views_delegate_.reset(CreateViewsDelegate()); |
+ views_delegate_.reset(CreateViewsDelegate(context_factory)); |
#endif |
// Subclasses can provide their own Profile. |
@@ -242,11 +244,14 @@ Browser* BrowserWithTestWindowTest::CreateBrowser( |
} |
#if !defined(OS_CHROMEOS) && defined(TOOLKIT_VIEWS) |
-views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate() { |
+views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate( |
+ ui::ContextFactory* context_factory) { |
#if defined(USE_ASH) |
- return new ash::test::AshTestViewsDelegate; |
+ views::TestViewsDelegate* delegate = new ash::test::AshTestViewsDelegate; |
#else |
- return new views::TestViewsDelegate; |
+ views::TestViewsDelegate* delegate = new views::TestViewsDelegate; |
#endif |
+ delegate->set_context_factory(context_factory); |
+ return delegate; |
} |
#endif |