| 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 "components/mus/ws/test_utils.h" | 5 #include "components/mus/ws/test_utils.h" |
| 6 | 6 |
| 7 #include "cc/output/copy_output_request.h" | 7 #include "cc/output/copy_output_request.h" |
| 8 #include "components/mus/surfaces/surfaces_state.h" | 8 #include "components/mus/surfaces/surfaces_state.h" |
| 9 #include "components/mus/ws/display_binding.h" | 9 #include "components/mus/ws/display_binding.h" |
| 10 #include "components/mus/ws/window_manager_access_policy.h" | 10 #include "components/mus/ws/window_manager_access_policy.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 TestWindowTreeClient::~TestWindowTreeClient() {} | 154 TestWindowTreeClient::~TestWindowTreeClient() {} |
| 155 | 155 |
| 156 void TestWindowTreeClient::Bind( | 156 void TestWindowTreeClient::Bind( |
| 157 mojo::InterfaceRequest<mojom::WindowTreeClient> request) { | 157 mojo::InterfaceRequest<mojom::WindowTreeClient> request) { |
| 158 binding_.Bind(std::move(request)); | 158 binding_.Bind(std::move(request)); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void TestWindowTreeClient::OnEmbed(uint16_t connection_id, | 161 void TestWindowTreeClient::OnEmbed(uint16_t connection_id, |
| 162 mojom::WindowDataPtr root, | 162 mojom::WindowDataPtr root, |
| 163 mus::mojom::WindowTreePtr tree, | 163 mus::mojom::WindowTreePtr tree, |
| 164 Id focused_window_id) { | 164 Id focused_window_id, |
| 165 bool drawn) { |
| 165 // TODO(sky): add test coverage of |focused_window_id|. | 166 // TODO(sky): add test coverage of |focused_window_id|. |
| 166 tracker_.OnEmbed(connection_id, std::move(root)); | 167 tracker_.OnEmbed(connection_id, std::move(root), drawn); |
| 167 } | 168 } |
| 168 | 169 |
| 169 void TestWindowTreeClient::OnEmbeddedAppDisconnected(uint32_t window) { | 170 void TestWindowTreeClient::OnEmbeddedAppDisconnected(uint32_t window) { |
| 170 tracker_.OnEmbeddedAppDisconnected(window); | 171 tracker_.OnEmbeddedAppDisconnected(window); |
| 171 } | 172 } |
| 172 | 173 |
| 173 void TestWindowTreeClient::OnUnembed(Id window_id) { | 174 void TestWindowTreeClient::OnUnembed(Id window_id) { |
| 174 tracker_.OnUnembed(window_id); | 175 tracker_.OnUnembed(window_id); |
| 175 } | 176 } |
| 176 | 177 |
| 177 void TestWindowTreeClient::OnLostCapture(Id window_id) {} | 178 void TestWindowTreeClient::OnLostCapture(Id window_id) {} |
| 178 | 179 |
| 179 void TestWindowTreeClient::OnTopLevelCreated(uint32_t change_id, | 180 void TestWindowTreeClient::OnTopLevelCreated(uint32_t change_id, |
| 180 mojom::WindowDataPtr data) { | 181 mojom::WindowDataPtr data, |
| 181 tracker_.OnTopLevelCreated(change_id, std::move(data)); | 182 bool drawn) { |
| 183 tracker_.OnTopLevelCreated(change_id, std::move(data), drawn); |
| 182 } | 184 } |
| 183 | 185 |
| 184 void TestWindowTreeClient::OnWindowBoundsChanged(uint32_t window, | 186 void TestWindowTreeClient::OnWindowBoundsChanged(uint32_t window, |
| 185 mojo::RectPtr old_bounds, | 187 mojo::RectPtr old_bounds, |
| 186 mojo::RectPtr new_bounds) { | 188 mojo::RectPtr new_bounds) { |
| 187 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds), | 189 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds), |
| 188 std::move(new_bounds)); | 190 std::move(new_bounds)); |
| 189 } | 191 } |
| 190 | 192 |
| 191 void TestWindowTreeClient::OnClientAreaChanged( | 193 void TestWindowTreeClient::OnClientAreaChanged( |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 228 |
| 227 void TestWindowTreeClient::OnWindowDeleted(uint32_t window) { | 229 void TestWindowTreeClient::OnWindowDeleted(uint32_t window) { |
| 228 tracker_.OnWindowDeleted(window); | 230 tracker_.OnWindowDeleted(window); |
| 229 } | 231 } |
| 230 | 232 |
| 231 void TestWindowTreeClient::OnWindowVisibilityChanged(uint32_t window, | 233 void TestWindowTreeClient::OnWindowVisibilityChanged(uint32_t window, |
| 232 bool visible) { | 234 bool visible) { |
| 233 tracker_.OnWindowVisibilityChanged(window, visible); | 235 tracker_.OnWindowVisibilityChanged(window, visible); |
| 234 } | 236 } |
| 235 | 237 |
| 236 void TestWindowTreeClient::OnWindowDrawnStateChanged(uint32_t window, | 238 void TestWindowTreeClient::OnWindowParentDrawnStateChanged(uint32_t window, |
| 237 bool drawn) { | 239 bool drawn) { |
| 238 tracker_.OnWindowDrawnStateChanged(window, drawn); | 240 tracker_.OnWindowParentDrawnStateChanged(window, drawn); |
| 239 } | 241 } |
| 240 | 242 |
| 241 void TestWindowTreeClient::OnWindowSharedPropertyChanged( | 243 void TestWindowTreeClient::OnWindowSharedPropertyChanged( |
| 242 uint32_t window, | 244 uint32_t window, |
| 243 const mojo::String& name, | 245 const mojo::String& name, |
| 244 mojo::Array<uint8_t> new_data) { | 246 mojo::Array<uint8_t> new_data) { |
| 245 tracker_.OnWindowSharedPropertyChanged(window, name, std::move(new_data)); | 247 tracker_.OnWindowSharedPropertyChanged(window, name, std::move(new_data)); |
| 246 } | 248 } |
| 247 | 249 |
| 248 void TestWindowTreeClient::OnWindowInputEvent(uint32_t event_id, | 250 void TestWindowTreeClient::OnWindowInputEvent(uint32_t event_id, |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 return nullptr; | 357 return nullptr; |
| 356 if (!tree->AddWindow(parent_client_id, client_window_id)) | 358 if (!tree->AddWindow(parent_client_id, client_window_id)) |
| 357 return nullptr; | 359 return nullptr; |
| 358 *client_id = client_window_id; | 360 *client_id = client_window_id; |
| 359 return tree->GetWindowByClientId(client_window_id); | 361 return tree->GetWindowByClientId(client_window_id); |
| 360 } | 362 } |
| 361 | 363 |
| 362 } // namespace test | 364 } // namespace test |
| 363 } // namespace ws | 365 } // namespace ws |
| 364 } // namespace mus | 366 } // namespace mus |
| OLD | NEW |