| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_TEST_H_ | 5 #ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_TEST_H_ |
| 6 #define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_TEST_H_ | 6 #define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_TEST_H_ |
| 7 | 7 |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "ui/ozone/platform/wayland/fake_server.h" | 9 #include "ui/ozone/platform/wayland/fake_server.h" |
| 10 #include "ui/ozone/platform/wayland/mock_platform_window_delegate.h" | 10 #include "ui/ozone/platform/wayland/mock_platform_window_delegate.h" |
| 11 #include "ui/ozone/platform/wayland/wayland_display.h" | 11 #include "ui/ozone/platform/wayland/wayland_connection.h" |
| 12 #include "ui/ozone/platform/wayland/wayland_window.h" | 12 #include "ui/ozone/platform/wayland/wayland_window.h" |
| 13 | 13 |
| 14 namespace ui { | 14 namespace ui { |
| 15 | 15 |
| 16 // WaylandTest is a base class that sets up a display, window, and fake server, | 16 // WaylandTest is a base class that sets up a display, window, and fake server, |
| 17 // and allows easy synchronization between them. | 17 // and allows easy synchronization between them. |
| 18 class WaylandTest : public testing::Test { | 18 class WaylandTest : public testing::Test { |
| 19 public: | 19 public: |
| 20 WaylandTest(); | 20 WaylandTest(); |
| 21 ~WaylandTest() override; | 21 ~WaylandTest() override; |
| 22 | 22 |
| 23 void SetUp() override; | 23 void SetUp() override; |
| 24 void TearDown() override; | 24 void TearDown() override; |
| 25 | 25 |
| 26 void Sync(); | 26 void Sync(); |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 bool initialized = false; | 29 bool initialized = false; |
| 30 base::MessageLoopForUI message_loop; | 30 base::MessageLoopForUI message_loop; |
| 31 | 31 |
| 32 protected: | 32 protected: |
| 33 wl::FakeServer server; | 33 wl::FakeServer server; |
| 34 wl::MockSurface* surface; | 34 wl::MockSurface* surface; |
| 35 | 35 |
| 36 WaylandDisplay display; | 36 WaylandConnection connection; |
| 37 MockPlatformWindowDelegate delegate; | 37 MockPlatformWindowDelegate delegate; |
| 38 WaylandWindow window; | 38 WaylandWindow window; |
| 39 gfx::AcceleratedWidget widget = gfx::kNullAcceleratedWidget; | 39 gfx::AcceleratedWidget widget = gfx::kNullAcceleratedWidget; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 DISALLOW_COPY_AND_ASSIGN(WaylandTest); | 42 DISALLOW_COPY_AND_ASSIGN(WaylandTest); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace ui | 45 } // namespace ui |
| 46 | 46 |
| 47 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_TEST_H_ | 47 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_TEST_H_ |
| OLD | NEW |