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

Unified Diff: gpu/test_message_loop_type.h

Issue 2682393003: Change MessageLoop type for GPU tests with Ozone. (Closed)
Patch Set: Fix comment. Created 3 years, 10 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
« no previous file with comments | « gpu/ipc/service/gpu_channel_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/test_message_loop_type.h
diff --git a/gpu/test_message_loop_type.h b/gpu/test_message_loop_type.h
new file mode 100644
index 0000000000000000000000000000000000000000..b2d97ff82a82ec14696c03c94bf8184a2a9f5b6c
--- /dev/null
+++ b/gpu/test_message_loop_type.h
@@ -0,0 +1,30 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_TEST_MESSAGE_LOOP_TYPE_H_
+#define GPU_TEST_MESSAGE_LOOP_TYPE_H_
+
+#include "base/message_loop/message_loop.h"
+
+#if defined(USE_OZONE)
+#include "ui/ozone/public/ozone_platform.h"
+#endif
+
+namespace gpu {
+namespace test {
+
+// Returns the MessageLoop type needed for GPU tests. The Ozone platform may not
+// work with TYPE_DEFAULT and this needs to be checked at runtime.
+inline base::MessageLoop::Type GetMessageLoopTypeForGpu() {
+#if defined(USE_OZONE)
+ return ui::OzonePlatform::EnsureInstance()->GetMessageLoopTypeForGpu();
+#else
+ return base::MessageLoop::TYPE_DEFAULT;
+#endif
+}
+
+} // namespace test
+} // namespace gpu
+
+#endif // GPU_TEST_MESSAGE_LOOP_TYPE_H_
« no previous file with comments | « gpu/ipc/service/gpu_channel_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698