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

Unified Diff: ui/ozone/platform/wayland/wayland_test.cc

Issue 1740303002: ozone/platform/wayland: Add WaylandTest base class to eliminate redundancy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « ui/ozone/platform/wayland/wayland_test.h ('k') | ui/ozone/platform/wayland/wayland_window_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/wayland/wayland_test.cc
diff --git a/ui/ozone/platform/wayland/wayland_test.cc b/ui/ozone/platform/wayland/wayland_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6fc266bc73d8007fa6636b8fd486672160f6eace
--- /dev/null
+++ b/ui/ozone/platform/wayland/wayland_test.cc
@@ -0,0 +1,39 @@
+// Copyright 2016 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.
+
+#include "ui/ozone/platform/wayland/wayland_test.h"
+
+namespace ui {
+
+WaylandTest::WaylandTest()
+ : window(&delegate, &display, gfx::Rect(0, 0, 800, 600)) {}
+
+WaylandTest::~WaylandTest() {}
+
+void WaylandTest::SetUp() {
+ ASSERT_TRUE(server.Start());
+ ASSERT_TRUE(display.Initialize());
+ ASSERT_TRUE(window.Initialize());
+ wl_display_roundtrip(display.display());
+
+ server.Pause();
+
+ surface = server.GetObject<wl::MockSurface>(window.GetWidget());
+ ASSERT_TRUE(surface);
+ initialized = true;
+}
+
+void WaylandTest::TearDown() {
+ server.Resume();
+ if (initialized)
+ wl_display_roundtrip(display.display());
+}
+
+void WaylandTest::Sync() {
+ server.Resume();
+ wl_display_roundtrip(display.display());
+ server.Pause();
+}
+
+} // namespace ui
« no previous file with comments | « ui/ozone/platform/wayland/wayland_test.h ('k') | ui/ozone/platform/wayland/wayland_window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698