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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 tree_->SetEventObserver(std::move(matcher), event_observer_id); | 117 tree_->SetEventObserver(std::move(matcher), event_observer_id); |
118 } | 118 } |
119 | 119 |
120 // DisplayTestApi ------------------------------------------------------------ | 120 // DisplayTestApi ------------------------------------------------------------ |
121 | 121 |
122 DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {} | 122 DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {} |
123 DisplayTestApi::~DisplayTestApi() {} | 123 DisplayTestApi::~DisplayTestApi() {} |
124 | 124 |
125 // EventDispatcherTestApi ---------------------------------------------------- | 125 // EventDispatcherTestApi ---------------------------------------------------- |
126 | 126 |
| 127 bool EventDispatcherTestApi::IsWindowPointerTarget( |
| 128 const ServerWindow* window) const { |
| 129 for (const auto& pair : ed_->pointer_targets_) { |
| 130 if (pair.second.window == window) |
| 131 return true; |
| 132 } |
| 133 return false; |
| 134 } |
| 135 |
127 int EventDispatcherTestApi::NumberPointerTargetsForWindow( | 136 int EventDispatcherTestApi::NumberPointerTargetsForWindow( |
128 ServerWindow* window) { | 137 ServerWindow* window) { |
129 int count = 0; | 138 int count = 0; |
130 for (const auto& pair : ed_->pointer_targets_) | 139 for (const auto& pair : ed_->pointer_targets_) |
131 if (pair.second.window == window) | 140 if (pair.second.window == window) |
132 count++; | 141 count++; |
133 return count; | 142 return count; |
134 } | 143 } |
135 | 144 |
136 // TestDisplayBinding --------------------------------------------------------- | 145 // TestDisplayBinding --------------------------------------------------------- |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 return nullptr; | 479 return nullptr; |
471 if (!tree->AddWindow(parent_client_id, client_window_id)) | 480 if (!tree->AddWindow(parent_client_id, client_window_id)) |
472 return nullptr; | 481 return nullptr; |
473 *client_id = client_window_id; | 482 *client_id = client_window_id; |
474 return tree->GetWindowByClientId(client_window_id); | 483 return tree->GetWindowByClientId(client_window_id); |
475 } | 484 } |
476 | 485 |
477 } // namespace test | 486 } // namespace test |
478 } // namespace ws | 487 } // namespace ws |
479 } // namespace mus | 488 } // namespace mus |
OLD | NEW |