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

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

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
Index: ui/ozone/platform/wayland/wayland_test.h
diff --git a/ui/ozone/platform/wayland/wayland_test.h b/ui/ozone/platform/wayland/wayland_test.h
new file mode 100644
index 0000000000000000000000000000000000000000..81cafb596d95a40b71a32f13569f8837d5cfc9d2
--- /dev/null
+++ b/ui/ozone/platform/wayland/wayland_test.h
@@ -0,0 +1,45 @@
+// 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.
+
+#ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_TEST_H_
+#define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_TEST_H_
+
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/ozone/platform/wayland/fake_server.h"
+#include "ui/ozone/platform/wayland/mock_platform_window_delegate.h"
+#include "ui/ozone/platform/wayland/wayland_display.h"
+#include "ui/ozone/platform/wayland/wayland_window.h"
+
+namespace ui {
+
+// WaylandTest is a base class that sets up a display, window, and fake server,
+// and allows easy synchronization between them.
+class WaylandTest : public testing::Test {
+ public:
+ WaylandTest();
+ ~WaylandTest() override;
+
+ void SetUp() override;
+ void TearDown() override;
+
+ void Sync();
+
+ private:
+ bool initialized = false;
+ wl::FakeServer server;
+
+ protected:
+ wl::MockSurface* surface;
+
+ WaylandDisplay display;
+ MockPlatformWindowDelegate delegate;
+ WaylandWindow window;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WaylandTest);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_TEST_H_
« no previous file with comments | « ui/ozone/platform/wayland/wayland_surface_factory_unittest.cc ('k') | ui/ozone/platform/wayland/wayland_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698