OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "services/ui/public/cpp/tests/window_server_test_base.h" | 5 #include "services/ui/public/cpp/tests/window_server_test_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 bool WindowServerTestBase::QuitRunLoop() { | 58 bool WindowServerTestBase::QuitRunLoop() { |
59 if (!current_run_loop) | 59 if (!current_run_loop) |
60 return false; | 60 return false; |
61 | 61 |
62 current_run_loop->Quit(); | 62 current_run_loop->Quit(); |
63 current_run_loop = nullptr; | 63 current_run_loop = nullptr; |
64 return true; | 64 return true; |
65 } | 65 } |
66 | 66 |
67 void WindowServerTestBase::SetUp() { | 67 void WindowServerTestBase::SetUp() { |
68 WindowServerShellTestBase::SetUp(); | 68 WindowServerServiceTestBase::SetUp(); |
69 | 69 |
70 CreateWindowTreeHost(connector(), this, &host_, this); | 70 CreateWindowTreeHost(connector(), this, &host_, this); |
71 | 71 |
72 ASSERT_TRUE(DoRunLoopWithTimeout()); // RunLoop should be quit by OnEmbed(). | 72 ASSERT_TRUE(DoRunLoopWithTimeout()); // RunLoop should be quit by OnEmbed(). |
73 std::swap(window_manager_, most_recent_client_); | 73 std::swap(window_manager_, most_recent_client_); |
74 } | 74 } |
75 | 75 |
76 bool WindowServerTestBase::OnConnect(shell::Connection* connection) { | 76 bool WindowServerTestBase::OnConnect(shell::Connection* connection) { |
77 connection->AddInterface<mojom::WindowTreeClient>(this); | 77 connection->AddInterface<mojom::WindowTreeClient>(this); |
78 return true; | 78 return true; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 if (window_manager_delegate_) | 135 if (window_manager_delegate_) |
136 window_manager_delegate_->OnAccelerator(id, event); | 136 window_manager_delegate_->OnAccelerator(id, event); |
137 } | 137 } |
138 | 138 |
139 void WindowServerTestBase::Create(shell::Connection* connection, | 139 void WindowServerTestBase::Create(shell::Connection* connection, |
140 mojom::WindowTreeClientRequest request) { | 140 mojom::WindowTreeClientRequest request) { |
141 new WindowTreeClient(this, nullptr, std::move(request)); | 141 new WindowTreeClient(this, nullptr, std::move(request)); |
142 } | 142 } |
143 | 143 |
144 } // namespace ui | 144 } // namespace ui |
OLD | NEW |