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

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: build fix for win and mac, but cros need crrev.com/1208603002 Created 4 years, 11 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
« ui/gl/test/gl_image_test_template.h ('K') | « ui/gl/test/gl_image_test_template.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d1b89ed21a0f4fda35366186d3fe6933ca4a5c50 100644
--- a/ui/gl/test/run_all_unittests.cc
+++ b/ui/gl/test/run_all_unittests.cc
@@ -4,6 +4,7 @@
#include "base/bind.h"
#include "base/macros.h"
+#include "base/message_loop/message_loop.h"
#include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h"
#include "build/build_config.h"
@@ -12,6 +13,12 @@
#include "base/test/mock_chrome_application_mac.h"
#endif
+#if defined(USE_OZONE)
+#include "ui/ozone/public/client_native_pixmap_factory.h"
+#include "ui/ozone/public/ozone_gpu_test_helper.h"
+#include "ui/ozone/public/ozone_platform.h"
+#endif
+
namespace {
class GlTestSuite : public base::TestSuite {
@@ -21,8 +28,20 @@ class GlTestSuite : public base::TestSuite {
protected:
void Initialize() override {
+ scoped_ptr<base::MessageLoop> message_loop(new base::MessageLoopForUI);
base::TestSuite::Initialize();
+#if defined(USE_OZONE)
+ ozone_ = ui::OzoneInitializerForTest::Create();
+ DCHECK(ozone_);
+
+ client_native_pixmap_factory_ = ui::ClientNativePixmapFactory::Create();
+ ui::ClientNativePixmapFactory::SetInstance(
+ client_native_pixmap_factory_.get());
+ ui::ClientNativePixmapFactory::GetInstance()->Initialize(
+ ui::OzonePlatform::GetInstance()->OpenClientNativePixmapDevice());
+#endif
+// TODO(reveman): initialize SurfaceTextureManager or IOSurfaceManager
#if defined(OS_MACOSX) && !defined(OS_IOS)
mock_cr_app::RegisterMockCrApp();
#endif
@@ -33,6 +52,10 @@ class GlTestSuite : public base::TestSuite {
}
private:
+#if defined(USE_OZONE)
+ scoped_ptr<ui::OzoneInitializerForTest> ozone_;
reveman 2016/01/13 15:50:09 |ozone_| is not very descriptive of what this is.
dshwang 2016/01/13 17:07:43 rename to |ozone_backend_for_test_|
+ scoped_ptr<ui::ClientNativePixmapFactory> client_native_pixmap_factory_;
+#endif
DISALLOW_COPY_AND_ASSIGN(GlTestSuite);
};
« ui/gl/test/gl_image_test_template.h ('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