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 "ui/ozone/platform/wayland/wayland_test.h" | 5 #include "ui/ozone/platform/wayland/wayland_test.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 | 8 |
9 using ::testing::SaveArg; | 9 using ::testing::SaveArg; |
10 using ::testing::_; | 10 using ::testing::_; |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
14 WaylandTest::WaylandTest() | 14 WaylandTest::WaylandTest() |
15 : window(&delegate, &display, gfx::Rect(0, 0, 800, 600)) {} | 15 : window(&delegate, &connection, gfx::Rect(0, 0, 800, 600)) {} |
16 | 16 |
17 WaylandTest::~WaylandTest() {} | 17 WaylandTest::~WaylandTest() {} |
18 | 18 |
19 void WaylandTest::SetUp() { | 19 void WaylandTest::SetUp() { |
20 ASSERT_TRUE(server.Start()); | 20 ASSERT_TRUE(server.Start()); |
21 ASSERT_TRUE(display.Initialize()); | 21 ASSERT_TRUE(connection.Initialize()); |
22 EXPECT_CALL(delegate, OnAcceleratedWidgetAvailable(_, _)) | 22 EXPECT_CALL(delegate, OnAcceleratedWidgetAvailable(_, _)) |
23 .WillOnce(SaveArg<0>(&widget)); | 23 .WillOnce(SaveArg<0>(&widget)); |
24 ASSERT_TRUE(window.Initialize()); | 24 ASSERT_TRUE(window.Initialize()); |
25 ASSERT_NE(widget, gfx::kNullAcceleratedWidget); | 25 ASSERT_NE(widget, gfx::kNullAcceleratedWidget); |
26 | 26 |
27 // Wait for the client to flush all pending requests from initialization. | 27 // Wait for the client to flush all pending requests from initialization. |
28 base::RunLoop().RunUntilIdle(); | 28 base::RunLoop().RunUntilIdle(); |
29 | 29 |
30 // Pause the server after it has responded to all incoming events. | 30 // Pause the server after it has responded to all incoming events. |
31 server.Pause(); | 31 server.Pause(); |
(...skipping 15 matching lines...) Expand all Loading... |
47 | 47 |
48 // Wait for the client to finish processing these events. | 48 // Wait for the client to finish processing these events. |
49 base::RunLoop().RunUntilIdle(); | 49 base::RunLoop().RunUntilIdle(); |
50 | 50 |
51 // Pause the server, after it has finished processing any follow-up requests | 51 // Pause the server, after it has finished processing any follow-up requests |
52 // from the client. | 52 // from the client. |
53 server.Pause(); | 53 server.Pause(); |
54 } | 54 } |
55 | 55 |
56 } // namespace ui | 56 } // namespace ui |
OLD | NEW |