Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Side by Side Diff: ui/aura/test/mus/test_window_tree.cc

Issue 2456623002: Fixes to WindowTreeHostMus (Closed)
Patch Set: merge Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/aura/test/mus/test_window_tree.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/aura/test/mus/test_window_tree.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698