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 |