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

Unified Diff: ui/gl/test/run_all_unittests.cc

Issue 1484473003: gl, ozone: enable GLImageBindTest unittests Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase based on crrev.com/1879243002 Created 4 years, 8 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
Index: ui/gl/test/run_all_unittests.cc
diff --git a/ui/gl/test/run_all_unittests.cc b/ui/gl/test/run_all_unittests.cc
index e9af318893aae5aa8e402bc30135e04485935725..c12715d6c062c53120e39d70c1b7a7361f7cf283 100644
--- a/ui/gl/test/run_all_unittests.cc
+++ b/ui/gl/test/run_all_unittests.cc
@@ -11,6 +11,10 @@
#if defined(OS_MACOSX) && !defined(OS_IOS)
#include "base/test/mock_chrome_application_mac.h"
#endif
+#if defined(USE_OZONE)
+#include "base/message_loop/message_loop.h"
+#include "ui/ozone/public/client_native_pixmap_factory.h"
+#endif
namespace {
@@ -26,6 +30,13 @@ class GlTestSuite : public base::TestSuite {
#if defined(OS_MACOSX) && !defined(OS_IOS)
mock_cr_app::RegisterMockCrApp();
#endif
+#if defined(USE_OZONE)
+ // On Ozone, the backend initializes the event system using a UI thread.
+ message_loop_.reset(new base::MessageLoopForUI);
+ client_native_pixmap_factory_ = ui::ClientNativePixmapFactory::Create();
+ ui::ClientNativePixmapFactory::SetInstance(
+ client_native_pixmap_factory_.get());
+#endif
}
void Shutdown() override {
@@ -33,6 +44,10 @@ class GlTestSuite : public base::TestSuite {
}
private:
+#if defined(USE_OZONE)
+ std::unique_ptr<base::MessageLoop> message_loop_;
+ std::unique_ptr<ui::ClientNativePixmapFactory> client_native_pixmap_factory_;
+#endif
DISALLOW_COPY_AND_ASSIGN(GlTestSuite);
};
« ui/gl/gl_image_ozone_native_pixmap_unittest.cc ('K') | « ui/gl/test/gl_image_test_template.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698