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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 WindowTreeTestApi::WindowTreeTestApi(WindowTree* tree) : tree_(tree) {} | 109 WindowTreeTestApi::WindowTreeTestApi(WindowTree* tree) : tree_(tree) {} |
110 WindowTreeTestApi::~WindowTreeTestApi() {} | 110 WindowTreeTestApi::~WindowTreeTestApi() {} |
111 | 111 |
112 // DisplayTestApi ------------------------------------------------------------ | 112 // DisplayTestApi ------------------------------------------------------------ |
113 | 113 |
114 DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {} | 114 DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {} |
115 DisplayTestApi::~DisplayTestApi() {} | 115 DisplayTestApi::~DisplayTestApi() {} |
116 | 116 |
117 // EventDispatcherTestApi ---------------------------------------------------- | 117 // EventDispatcherTestApi ---------------------------------------------------- |
118 | 118 |
| 119 bool EventDispatcherTestApi::IsWindowPointerTarget( |
| 120 const ServerWindow* window) const { |
| 121 for (const auto& pair : ed_->pointer_targets_) { |
| 122 if (pair.second.window == window) |
| 123 return true; |
| 124 } |
| 125 return false; |
| 126 } |
| 127 |
119 int EventDispatcherTestApi::NumberPointerTargetsForWindow( | 128 int EventDispatcherTestApi::NumberPointerTargetsForWindow( |
120 ServerWindow* window) { | 129 ServerWindow* window) { |
121 int count = 0; | 130 int count = 0; |
122 for (const auto& pair : ed_->pointer_targets_) | 131 for (const auto& pair : ed_->pointer_targets_) |
123 if (pair.second.window == window) | 132 if (pair.second.window == window) |
124 count++; | 133 count++; |
125 return count; | 134 return count; |
126 } | 135 } |
127 | 136 |
128 // TestDisplayBinding --------------------------------------------------------- | 137 // TestDisplayBinding --------------------------------------------------------- |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 return nullptr; | 376 return nullptr; |
368 if (!tree->AddWindow(parent_client_id, client_window_id)) | 377 if (!tree->AddWindow(parent_client_id, client_window_id)) |
369 return nullptr; | 378 return nullptr; |
370 *client_id = client_window_id; | 379 *client_id = client_window_id; |
371 return tree->GetWindowByClientId(client_window_id); | 380 return tree->GetWindowByClientId(client_window_id); |
372 } | 381 } |
373 | 382 |
374 } // namespace test | 383 } // namespace test |
375 } // namespace ws | 384 } // namespace ws |
376 } // namespace mus | 385 } // namespace mus |
OLD | NEW |