| 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 |
| 125 int EventDispatcherTestApi::NumberPointerTargetsForWindow( | 134 int EventDispatcherTestApi::NumberPointerTargetsForWindow( |
| 126 ServerWindow* window) { | 135 ServerWindow* window) { |
| 127 int count = 0; | 136 int count = 0; |
| 128 for (const auto& pair : ed_->pointer_targets_) | 137 for (const auto& pair : ed_->pointer_targets_) |
| 129 if (pair.second.window == window) | 138 if (pair.second.window == window) |
| 130 count++; | 139 count++; |
| 131 return count; | 140 return count; |
| 132 } | 141 } |
| 133 | 142 |
| 134 // TestDisplayBinding --------------------------------------------------------- | 143 // TestDisplayBinding --------------------------------------------------------- |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 return nullptr; | 390 return nullptr; |
| 382 if (!tree->AddWindow(parent_client_id, client_window_id)) | 391 if (!tree->AddWindow(parent_client_id, client_window_id)) |
| 383 return nullptr; | 392 return nullptr; |
| 384 *client_id = client_window_id; | 393 *client_id = client_window_id; |
| 385 return tree->GetWindowByClientId(client_window_id); | 394 return tree->GetWindowByClientId(client_window_id); |
| 386 } | 395 } |
| 387 | 396 |
| 388 } // namespace test | 397 } // namespace test |
| 389 } // namespace ws | 398 } // namespace ws |
| 390 } // namespace mus | 399 } // namespace mus |
| OLD | NEW |