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

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

Issue 2752303002: views/mus: Install a mus-friend ContextFactory for tests. (Closed)
Patch Set: . Created 3 years, 9 months 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/test/platform_test_helper.cc ('k') | ui/views/view_unittest.cc » ('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 051f8e64bc21f92fd0b18fa1bc5071429b801411..05727dbe06774f34aa14d29a218cc8d84e6563b4 100644
--- a/ui/views/test/scoped_views_test_helper.cc
+++ b/ui/views/test/scoped_views_test_helper.cc
@@ -11,7 +11,6 @@
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/ime/input_method_initializer.h"
#include "ui/base/test/test_clipboard.h"
-#include "ui/compositor/test/context_factories_for_test.h"
#include "ui/views/test/platform_test_helper.h"
#include "ui/views/test/test_views_delegate.h"
#include "ui/views/test/views_test_helper.h"
@@ -26,11 +25,10 @@ ScopedViewsTestHelper::ScopedViewsTestHelper(
: views_delegate_(std::move(views_delegate)),
platform_test_helper_(PlatformTestHelper::Create()) {
// The ContextFactory must exist before any Compositors are created.
- bool enable_pixel_output = false;
ui::ContextFactory* context_factory = nullptr;
ui::ContextFactoryPrivate* context_factory_private = nullptr;
- ui::InitializeContextFactoryForTests(enable_pixel_output, &context_factory,
- &context_factory_private);
+ platform_test_helper_->InitializeContextFactory(&context_factory,
+ &context_factory_private);
views_delegate_->set_context_factory(context_factory);
views_delegate_->set_context_factory_private(context_factory_private);
@@ -56,8 +54,6 @@ ScopedViewsTestHelper::~ScopedViewsTestHelper() {
// The Mus PlatformTestHelper has state that is deleted by
// ui::TerminateContextFactoryForTests().
platform_test_helper_.reset();
-
- ui::TerminateContextFactoryForTests();
}
gfx::NativeWindow ScopedViewsTestHelper::GetContext() {
« no previous file with comments | « ui/views/test/platform_test_helper.cc ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698