Chromium Code Reviews| 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); |
| }; |