| 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 "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "cc/output/copy_output_request.h" | 8 #include "cc/output/copy_output_request.h" |
| 9 #include "components/mus/surfaces/surfaces_state.h" | 9 #include "components/mus/surfaces/surfaces_state.h" |
| 10 #include "components/mus/ws/display_binding.h" | 10 #include "components/mus/ws/display_binding.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 TestWindowTreeClient::~TestWindowTreeClient() {} | 175 TestWindowTreeClient::~TestWindowTreeClient() {} |
| 176 | 176 |
| 177 void TestWindowTreeClient::Bind( | 177 void TestWindowTreeClient::Bind( |
| 178 mojo::InterfaceRequest<mojom::WindowTreeClient> request) { | 178 mojo::InterfaceRequest<mojom::WindowTreeClient> request) { |
| 179 binding_.Bind(std::move(request)); | 179 binding_.Bind(std::move(request)); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void TestWindowTreeClient::OnEmbed(uint16_t client_id, | 182 void TestWindowTreeClient::OnEmbed(uint16_t client_id, |
| 183 mojom::WindowDataPtr root, | 183 mojom::WindowDataPtr root, |
| 184 mus::mojom::WindowTreePtr tree, | 184 mus::mojom::WindowTreePtr tree, |
| 185 int64_t display_id, |
| 185 Id focused_window_id, | 186 Id focused_window_id, |
| 186 bool drawn) { | 187 bool drawn) { |
| 187 // TODO(sky): add test coverage of |focused_window_id|. | 188 // TODO(sky): add test coverage of |focused_window_id|. |
| 188 tracker_.OnEmbed(client_id, std::move(root), drawn); | 189 tracker_.OnEmbed(client_id, std::move(root), drawn); |
| 189 } | 190 } |
| 190 | 191 |
| 191 void TestWindowTreeClient::OnEmbeddedAppDisconnected(uint32_t window) { | 192 void TestWindowTreeClient::OnEmbeddedAppDisconnected(uint32_t window) { |
| 192 tracker_.OnEmbeddedAppDisconnected(window); | 193 tracker_.OnEmbeddedAppDisconnected(window); |
| 193 } | 194 } |
| 194 | 195 |
| 195 void TestWindowTreeClient::OnUnembed(Id window_id) { | 196 void TestWindowTreeClient::OnUnembed(Id window_id) { |
| 196 tracker_.OnUnembed(window_id); | 197 tracker_.OnUnembed(window_id); |
| 197 } | 198 } |
| 198 | 199 |
| 199 void TestWindowTreeClient::OnLostCapture(Id window_id) {} | 200 void TestWindowTreeClient::OnLostCapture(Id window_id) {} |
| 200 | 201 |
| 201 void TestWindowTreeClient::OnTopLevelCreated(uint32_t change_id, | 202 void TestWindowTreeClient::OnTopLevelCreated(uint32_t change_id, |
| 202 mojom::WindowDataPtr data, | 203 mojom::WindowDataPtr data, |
| 204 int64_t display_id, |
| 203 bool drawn) { | 205 bool drawn) { |
| 204 tracker_.OnTopLevelCreated(change_id, std::move(data), drawn); | 206 tracker_.OnTopLevelCreated(change_id, std::move(data), drawn); |
| 205 } | 207 } |
| 206 | 208 |
| 207 void TestWindowTreeClient::OnWindowBoundsChanged(uint32_t window, | 209 void TestWindowTreeClient::OnWindowBoundsChanged(uint32_t window, |
| 208 mojo::RectPtr old_bounds, | 210 mojo::RectPtr old_bounds, |
| 209 mojo::RectPtr new_bounds) { | 211 mojo::RectPtr new_bounds) { |
| 210 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds), | 212 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds), |
| 211 std::move(new_bounds)); | 213 std::move(new_bounds)); |
| 212 } | 214 } |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 return nullptr; | 487 return nullptr; |
| 486 if (!tree->AddWindow(parent_client_id, client_window_id)) | 488 if (!tree->AddWindow(parent_client_id, client_window_id)) |
| 487 return nullptr; | 489 return nullptr; |
| 488 *client_id = client_window_id; | 490 *client_id = client_window_id; |
| 489 return tree->GetWindowByClientId(client_window_id); | 491 return tree->GetWindowByClientId(client_window_id); |
| 490 } | 492 } |
| 491 | 493 |
| 492 } // namespace test | 494 } // namespace test |
| 493 } // namespace ws | 495 } // namespace ws |
| 494 } // namespace mus | 496 } // namespace mus |
| OLD | NEW |