OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include <wayland-server-core.h> |
| 6 #include <xdg-shell-unstable-v5-server-protocol.h> |
| 7 |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "ui/ozone/platform/wayland/fake_server.h" |
| 10 #include "ui/ozone/platform/wayland/wayland_display.h" |
| 11 |
| 12 namespace ui { |
| 13 |
| 14 TEST(WaylandDisplayTest, UseUnstableVersion) { |
| 15 wl::FakeServer server; |
| 16 EXPECT_CALL(*server.xdg_shell(), |
| 17 UseUnstableVersion(XDG_SHELL_VERSION_CURRENT)); |
| 18 ASSERT_TRUE(server.Start()); |
| 19 WaylandDisplay display; |
| 20 ASSERT_TRUE(display.Initialize()); |
| 21 wl_display_roundtrip(display.display()); |
| 22 } |
| 23 |
| 24 TEST(WaylandDisplayTest, Ping) { |
| 25 wl::FakeServer server; |
| 26 ASSERT_TRUE(server.Start()); |
| 27 WaylandDisplay display; |
| 28 ASSERT_TRUE(display.Initialize()); |
| 29 wl_display_roundtrip(display.display()); |
| 30 |
| 31 server.Pause(); |
| 32 |
| 33 xdg_shell_send_ping(server.xdg_shell()->resource(), 1234); |
| 34 EXPECT_CALL(*server.xdg_shell(), Pong(1234)); |
| 35 server.Flush(); |
| 36 |
| 37 server.Resume(); |
| 38 |
| 39 wl_display_roundtrip(display.display()); |
| 40 } |
| 41 |
| 42 } // namespace ui |
OLD | NEW |