| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ui/aura/test/mus/test_window_tree.h" | 5 #include "ui/aura/test/mus/test_window_tree.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace aura { | 9 namespace aura { |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 for (auto iter = changes_.begin(); iter != changes_.end(); ++iter) { | 78 for (auto iter = changes_.begin(); iter != changes_.end(); ++iter) { |
| 79 if (iter->type != type) | 79 if (iter->type != type) |
| 80 continue; | 80 continue; |
| 81 *change_id = iter->id; | 81 *change_id = iter->id; |
| 82 changes_.erase(iter); | 82 changes_.erase(iter); |
| 83 return true; | 83 return true; |
| 84 } | 84 } |
| 85 return false; | 85 return false; |
| 86 } | 86 } |
| 87 | 87 |
| 88 size_t TestWindowTree::GetChangeCountForType(WindowTreeChangeType type) { |
| 89 size_t count = 0; |
| 90 for (const auto& change : changes_) { |
| 91 if (change.type == type) |
| 92 ++count; |
| 93 } |
| 94 return count; |
| 95 } |
| 96 |
| 88 void TestWindowTree::OnChangeReceived(uint32_t change_id, | 97 void TestWindowTree::OnChangeReceived(uint32_t change_id, |
| 89 WindowTreeChangeType type) { | 98 WindowTreeChangeType type) { |
| 90 changes_.push_back({type, change_id}); | 99 changes_.push_back({type, change_id}); |
| 91 } | 100 } |
| 92 | 101 |
| 93 void TestWindowTree::NewWindow( | 102 void TestWindowTree::NewWindow( |
| 94 uint32_t change_id, | 103 uint32_t change_id, |
| 95 uint32_t window_id, | 104 uint32_t window_id, |
| 96 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) { | 105 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) { |
| 97 last_new_window_properties_ = std::move(properties); | 106 last_new_window_properties_ = std::move(properties); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 void TestWindowTree::PerformWindowMove(uint32_t change_id, | 271 void TestWindowTree::PerformWindowMove(uint32_t change_id, |
| 263 uint32_t window_id, | 272 uint32_t window_id, |
| 264 ui::mojom::MoveLoopSource source, | 273 ui::mojom::MoveLoopSource source, |
| 265 const gfx::Point& cursor_location) { | 274 const gfx::Point& cursor_location) { |
| 266 OnChangeReceived(change_id); | 275 OnChangeReceived(change_id); |
| 267 } | 276 } |
| 268 | 277 |
| 269 void TestWindowTree::CancelWindowMove(uint32_t window_id) {} | 278 void TestWindowTree::CancelWindowMove(uint32_t window_id) {} |
| 270 | 279 |
| 271 } // namespace aura | 280 } // namespace aura |
| OLD | NEW |