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

Unified Diff: ui/ozone/public/ozone_gpu_test_helper.cc

Issue 1208603002: content: implement unittests backend for Ozone GBM Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Mac bots 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
Index: ui/ozone/public/ozone_gpu_test_helper.cc
diff --git a/ui/ozone/public/ozone_gpu_test_helper.cc b/ui/ozone/public/ozone_gpu_test_helper.cc
index fe5a17b31cdb9775f7337863131e9ac4c3f14c02..cadf63056458917a888f81e3c1381be067425fbd 100644
--- a/ui/ozone/public/ozone_gpu_test_helper.cc
+++ b/ui/ozone/public/ozone_gpu_test_helper.cc
@@ -4,6 +4,7 @@
#include "ui/ozone/public/ozone_gpu_test_helper.h"
+#include "base/run_loop.h"
#include "base/thread_task_runner_handle.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_message.h"
@@ -131,4 +132,32 @@ bool OzoneGpuTestHelper::Initialize(
return true;
}
+// static
+scoped_ptr<OzoneInitializerForTest> OzoneInitializerForTest::Create() {
+ scoped_ptr<OzoneInitializerForTest> self(new OzoneInitializerForTest());
+ if (!self->Initialize())
+ return nullptr;
+ return self;
+}
+
+OzoneInitializerForTest::OzoneInitializerForTest() {}
+
+OzoneInitializerForTest::~OzoneInitializerForTest() {}
+
+bool OzoneInitializerForTest::Initialize() {
+ OzonePlatform::InitializeForUI();
+ OzonePlatform::InitializeForGPU();
+ gpu_helper_.reset(new OzoneGpuTestHelper);
+ if (!gpu_helper_->Initialize(base::ThreadTaskRunnerHandle::Get(),
+ base::ThreadTaskRunnerHandle::Get())) {
+ return false;
+ }
+ {
+ base::MessageLoop::ScopedNestableTaskAllower allow(
+ base::MessageLoop::current());
+ base::RunLoop().RunUntilIdle();
+ }
+ return true;
+}
+
} // namespace ui
« ui/ozone/public/ozone_gpu_test_helper.h ('K') | « ui/ozone/public/ozone_gpu_test_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698