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

Unified Diff: ui/views/test/platform_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.h ('k') | ui/views/test/scoped_views_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/platform_test_helper.cc
diff --git a/ui/views/test/platform_test_helper.cc b/ui/views/test/platform_test_helper.cc
index c6204abde63baed51cf57c37f4ad3fdb44632be7..0816cdf417c3e3f597e52612332897875995c855 100644
--- a/ui/views/test/platform_test_helper.cc
+++ b/ui/views/test/platform_test_helper.cc
@@ -7,6 +7,7 @@
#include "base/callback.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
+#include "ui/compositor/test/context_factories_for_test.h"
#include "ui/views/widget/widget.h"
#if defined(USE_AURA)
@@ -21,6 +22,10 @@ bool is_mus = false;
} // namespace
+PlatformTestHelper::~PlatformTestHelper() {
+ ui::TerminateContextFactoryForTests();
+}
+
void PlatformTestHelper::set_factory(const Factory& factory) {
DCHECK(test_helper_factory.is_null());
test_helper_factory = factory;
@@ -49,4 +54,12 @@ void PlatformTestHelper::SimulateNativeDestroy(Widget* widget) {
}
#endif
+void PlatformTestHelper::InitializeContextFactory(
+ ui::ContextFactory** context_factory,
+ ui::ContextFactoryPrivate** context_factory_private) {
+ bool enable_pixel_output = false;
+ ui::InitializeContextFactoryForTests(enable_pixel_output, context_factory,
+ context_factory_private);
+}
+
} // namespace views
« no previous file with comments | « ui/views/test/platform_test_helper.h ('k') | ui/views/test/scoped_views_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698