Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Unified Diff: ui/views/test/scoped_views_test_helper.cc

Issue 2563783002: ui + mus: Split ContextFactory into ContextFactory(Client) and ContextFactoryPrivate (Closed)
Patch Set: Restore mash Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/mus/surface_context_factory.cc ('k') | ui/views/test/test_views_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/scoped_views_test_helper.cc
diff --git a/ui/views/test/scoped_views_test_helper.cc b/ui/views/test/scoped_views_test_helper.cc
index 1cfaabe7839040b50563e03d1054fd49a500e7c1..a67ca6e8cffa599f7b69f08296062cd77668e0d7 100644
--- a/ui/views/test/scoped_views_test_helper.cc
+++ b/ui/views/test/scoped_views_test_helper.cc
@@ -33,17 +33,25 @@ ScopedViewsTestHelper::ScopedViewsTestHelper(
bool enable_pixel_output = false;
#if defined(USE_AURA)
ui::ContextFactory* old_context_factory = nullptr;
+ ui::ContextFactoryPrivate* old_context_factory_private = nullptr;
if (PlatformTestHelper::IsMus()) {
old_context_factory = aura::Env::GetInstance()->context_factory();
DCHECK(old_context_factory);
+ old_context_factory_private =
+ aura::Env::GetInstance()->context_factory_private();
}
#endif
- ui::ContextFactory* context_factory =
- ui::InitializeContextFactoryForTests(enable_pixel_output);
+ ui::ContextFactory* context_factory = nullptr;
+ ui::ContextFactoryPrivate* context_factory_private = nullptr;
+ ui::InitializeContextFactoryForTests(enable_pixel_output, &context_factory,
+ &context_factory_private);
+
views_delegate_->set_context_factory(context_factory);
+ views_delegate_->set_context_factory_private(context_factory_private);
test_helper_.reset(ViewsTestHelper::Create(base::MessageLoopForUI::current(),
- context_factory));
+ context_factory,
+ context_factory_private));
platform_test_helper_->OnTestHelperCreated(test_helper_.get());
test_helper_->SetUp();
@@ -55,8 +63,11 @@ ScopedViewsTestHelper::ScopedViewsTestHelper(
// the corresponding ui::Windows). So restore the context-factory (which
// WindowManagerConnection would have set up), so that NativeWidgetMus
// installs the correct context-factory that can talk to mus.
- if (PlatformTestHelper::IsMus())
+ if (PlatformTestHelper::IsMus()) {
aura::Env::GetInstance()->set_context_factory(old_context_factory);
+ aura::Env::GetInstance()->set_context_factory_private(
+ old_context_factory_private);
+ }
#endif
ui::InitializeInputMethodForTesting();
« no previous file with comments | « ui/views/mus/surface_context_factory.cc ('k') | ui/views/test/test_views_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698