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 #include <wayland-server-core.h> | 5 #include <wayland-server-core.h> |
6 #include <xdg-shell-unstable-v5-server-protocol.h> | 6 #include <xdg-shell-unstable-v5-server-protocol.h> |
7 | 7 |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/ozone/platform/wayland/fake_server.h" | 10 #include "ui/ozone/platform/wayland/fake_server.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 server.Pause(); | 38 server.Pause(); |
39 | 39 |
40 xdg_shell_send_ping(server.xdg_shell()->resource(), 1234); | 40 xdg_shell_send_ping(server.xdg_shell()->resource(), 1234); |
41 EXPECT_CALL(*server.xdg_shell(), Pong(1234)); | 41 EXPECT_CALL(*server.xdg_shell(), Pong(1234)); |
42 | 42 |
43 server.Resume(); | 43 server.Resume(); |
44 base::RunLoop().RunUntilIdle(); | 44 base::RunLoop().RunUntilIdle(); |
45 server.Pause(); | 45 server.Pause(); |
46 } | 46 } |
47 | 47 |
| 48 TEST(WaylandDisplayTest, Output) { |
| 49 base::MessageLoopForUI message_loop; |
| 50 display::Display fake_display(1, gfx::Rect(0, 0, 800, 600)); |
| 51 wl::FakeServer server; |
| 52 server.AddDisplay(fake_display); |
| 53 ASSERT_TRUE(server.Start()); |
| 54 WaylandDisplay display; |
| 55 ASSERT_TRUE(display.Initialize()); |
| 56 display.StartProcessingEvents(); |
| 57 |
| 58 base::RunLoop run_loop; |
| 59 display.SetOutputCompleteClosure(run_loop.QuitClosure()); |
| 60 run_loop.Run(); |
| 61 |
| 62 ASSERT_TRUE(display.GetScreenList().size() == 1); |
| 63 WaylandScreen* screen = display.PrimaryScreen(); |
| 64 ASSERT_TRUE(screen->Geometry().width() == 800); |
| 65 ASSERT_TRUE(screen->Geometry().height() == 600); |
| 66 |
| 67 server.Resume(); |
| 68 base::RunLoop().RunUntilIdle(); |
| 69 server.Pause(); |
| 70 } |
| 71 |
48 } // namespace ui | 72 } // namespace ui |
OLD | NEW |