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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 tree_->SetEventObserver(std::move(matcher), event_observer_id); | 115 tree_->SetEventObserver(std::move(matcher), event_observer_id); |
116 } | 116 } |
117 | 117 |
118 // DisplayTestApi ------------------------------------------------------------ | 118 // DisplayTestApi ------------------------------------------------------------ |
119 | 119 |
120 DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {} | 120 DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {} |
121 DisplayTestApi::~DisplayTestApi() {} | 121 DisplayTestApi::~DisplayTestApi() {} |
122 | 122 |
123 // EventDispatcherTestApi ---------------------------------------------------- | 123 // EventDispatcherTestApi ---------------------------------------------------- |
124 | 124 |
125 bool EventDispatcherTestApi::IsWindowPointerTarget( | |
126 const ServerWindow* window) const { | |
127 for (const auto& pair : ed_->pointer_targets_) { | |
128 if (pair.second.window == window) | |
129 return true; | |
130 } | |
131 return false; | |
132 } | |
133 | |
134 int EventDispatcherTestApi::NumberPointerTargetsForWindow( | 125 int EventDispatcherTestApi::NumberPointerTargetsForWindow( |
135 ServerWindow* window) { | 126 ServerWindow* window) { |
136 int count = 0; | 127 int count = 0; |
137 for (const auto& pair : ed_->pointer_targets_) | 128 for (const auto& pair : ed_->pointer_targets_) |
138 if (pair.second.window == window) | 129 if (pair.second.window == window) |
139 count++; | 130 count++; |
140 return count; | 131 return count; |
141 } | 132 } |
142 | 133 |
143 // TestDisplayBinding --------------------------------------------------------- | 134 // TestDisplayBinding --------------------------------------------------------- |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 return nullptr; | 381 return nullptr; |
391 if (!tree->AddWindow(parent_client_id, client_window_id)) | 382 if (!tree->AddWindow(parent_client_id, client_window_id)) |
392 return nullptr; | 383 return nullptr; |
393 *client_id = client_window_id; | 384 *client_id = client_window_id; |
394 return tree->GetWindowByClientId(client_window_id); | 385 return tree->GetWindowByClientId(client_window_id); |
395 } | 386 } |
396 | 387 |
397 } // namespace test | 388 } // namespace test |
398 } // namespace ws | 389 } // namespace ws |
399 } // namespace mus | 390 } // namespace mus |
OLD | NEW |