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" |
11 #include "components/mus/ws/server_window_surface_manager_test_api.h" | 11 #include "components/mus/ws/server_window_surface_manager_test_api.h" |
12 #include "components/mus/ws/window_manager_access_policy.h" | 12 #include "components/mus/ws/window_manager_access_policy.h" |
13 #include "components/mus/ws/window_manager_factory_service.h" | 13 #include "components/mus/ws/window_manager_factory_service.h" |
14 #include "services/shell/public/interfaces/connector.mojom.h" | 14 #include "services/shell/public/interfaces/connector.mojom.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "ui/gfx/geometry/mojo/geometry_type_converters.h" | |
17 | 16 |
18 namespace mus { | 17 namespace mus { |
19 namespace ws { | 18 namespace ws { |
20 namespace test { | 19 namespace test { |
21 namespace { | 20 namespace { |
22 | 21 |
23 // ----------------------------------------------------------------------------- | 22 // ----------------------------------------------------------------------------- |
24 // Empty implementation of PlatformDisplay. | 23 // Empty implementation of PlatformDisplay. |
25 class TestPlatformDisplay : public PlatformDisplay { | 24 class TestPlatformDisplay : public PlatformDisplay { |
26 public: | 25 public: |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 void TestWindowTreeClient::OnLostCapture(Id window_id) {} | 198 void TestWindowTreeClient::OnLostCapture(Id window_id) {} |
200 | 199 |
201 void TestWindowTreeClient::OnTopLevelCreated(uint32_t change_id, | 200 void TestWindowTreeClient::OnTopLevelCreated(uint32_t change_id, |
202 mojom::WindowDataPtr data, | 201 mojom::WindowDataPtr data, |
203 int64_t display_id, | 202 int64_t display_id, |
204 bool drawn) { | 203 bool drawn) { |
205 tracker_.OnTopLevelCreated(change_id, std::move(data), drawn); | 204 tracker_.OnTopLevelCreated(change_id, std::move(data), drawn); |
206 } | 205 } |
207 | 206 |
208 void TestWindowTreeClient::OnWindowBoundsChanged(uint32_t window, | 207 void TestWindowTreeClient::OnWindowBoundsChanged(uint32_t window, |
209 mojo::RectPtr old_bounds, | 208 const gfx::Rect& old_bounds, |
210 mojo::RectPtr new_bounds) { | 209 const gfx::Rect& new_bounds) { |
211 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds), | 210 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds), |
212 std::move(new_bounds)); | 211 std::move(new_bounds)); |
213 } | 212 } |
214 | 213 |
215 void TestWindowTreeClient::OnClientAreaChanged( | 214 void TestWindowTreeClient::OnClientAreaChanged( |
216 uint32_t window_id, | 215 uint32_t window_id, |
217 mojo::InsetsPtr new_client_area, | 216 const gfx::Insets& new_client_area, |
218 mojo::Array<mojo::RectPtr> new_additional_client_areas) {} | 217 mojo::Array<gfx::Rect> new_additional_client_areas) {} |
219 | 218 |
220 void TestWindowTreeClient::OnTransientWindowAdded( | 219 void TestWindowTreeClient::OnTransientWindowAdded( |
221 uint32_t window_id, | 220 uint32_t window_id, |
222 uint32_t transient_window_id) {} | 221 uint32_t transient_window_id) {} |
223 | 222 |
224 void TestWindowTreeClient::OnTransientWindowRemoved( | 223 void TestWindowTreeClient::OnTransientWindowRemoved( |
225 uint32_t window_id, | 224 uint32_t window_id, |
226 uint32_t transient_window_id) {} | 225 uint32_t transient_window_id) {} |
227 | 226 |
228 void TestWindowTreeClient::OnWindowHierarchyChanged( | 227 void TestWindowTreeClient::OnWindowHierarchyChanged( |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 return nullptr; | 485 return nullptr; |
487 if (!tree->AddWindow(parent_client_id, client_window_id)) | 486 if (!tree->AddWindow(parent_client_id, client_window_id)) |
488 return nullptr; | 487 return nullptr; |
489 *client_id = client_window_id; | 488 *client_id = client_window_id; |
490 return tree->GetWindowByClientId(client_window_id); | 489 return tree->GetWindowByClientId(client_window_id); |
491 } | 490 } |
492 | 491 |
493 } // namespace test | 492 } // namespace test |
494 } // namespace ws | 493 } // namespace ws |
495 } // namespace mus | 494 } // namespace mus |
OLD | NEW |