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

Side by Side Diff: components/mus/public/cpp/tests/test_window_tree.cc

Issue 1567623003: Adds remainder of support for multiple roots to WS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment Created 4 years, 11 months 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
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 "components/mus/public/cpp/tests/test_window_tree.h" 5 #include "components/mus/public/cpp/tests/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 mus { 9 namespace mus {
10 10
11 TestWindowTree::TestWindowTree() : got_change_(false), change_id_(0) {} 11 TestWindowTree::TestWindowTree()
12 : got_change_(false), change_id_(0), window_id_(0u) {}
12 13
13 TestWindowTree::~TestWindowTree() {} 14 TestWindowTree::~TestWindowTree() {}
14 15
15 bool TestWindowTree::GetAndClearChangeId(uint32_t* change_id) { 16 bool TestWindowTree::GetAndClearChangeId(uint32_t* change_id) {
16 if (!got_change_) 17 if (!got_change_)
17 return false; 18 return false;
18 19
19 if (change_id) 20 if (change_id)
20 *change_id = change_id_; 21 *change_id = change_id_;
21 got_change_ = false; 22 got_change_ = false;
22 return true; 23 return true;
23 } 24 }
24 25
25 bool TestWindowTree::WasEventAcked(uint32_t event_id) const { 26 bool TestWindowTree::WasEventAcked(uint32_t event_id) const {
26 return acked_events_.count(event_id); 27 return acked_events_.count(event_id);
27 } 28 }
28 29
29 void TestWindowTree::NewWindow( 30 void TestWindowTree::NewWindow(
30 uint32_t change_id, 31 uint32_t change_id,
31 uint32_t window_id, 32 uint32_t window_id,
32 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) {} 33 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) {}
33 34
35 void TestWindowTree::NewTopLevelWindow(
36 uint32_t change_id,
37 uint32_t window_id,
38 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) {
39 got_change_ = true;
40 change_id_ = change_id;
41 window_id_ = window_id;
42 }
43
34 void TestWindowTree::DeleteWindow(uint32_t change_id, uint32_t window_id) {} 44 void TestWindowTree::DeleteWindow(uint32_t change_id, uint32_t window_id) {}
35 45
36 void TestWindowTree::SetWindowBounds(uint32_t change_id, 46 void TestWindowTree::SetWindowBounds(uint32_t change_id,
37 uint32_t window_id, 47 uint32_t window_id,
38 mojo::RectPtr bounds) { 48 mojo::RectPtr bounds) {
39 got_change_ = true; 49 got_change_ = true;
40 change_id_ = change_id; 50 change_id_ = change_id;
41 } 51 }
42 52
43 void TestWindowTree::SetClientArea( 53 void TestWindowTree::SetClientArea(
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 void TestWindowTree::OnWindowInputEventAck(uint32_t event_id) { 125 void TestWindowTree::OnWindowInputEventAck(uint32_t event_id) {
116 EXPECT_FALSE(acked_events_.count(event_id)); 126 EXPECT_FALSE(acked_events_.count(event_id));
117 acked_events_.insert(event_id); 127 acked_events_.insert(event_id);
118 } 128 }
119 129
120 void TestWindowTree::GetWindowManagerInternalClient( 130 void TestWindowTree::GetWindowManagerInternalClient(
121 mojo::AssociatedInterfaceRequest<mojom::WindowManagerInternalClient> 131 mojo::AssociatedInterfaceRequest<mojom::WindowManagerInternalClient>
122 internal) {} 132 internal) {}
123 133
124 } // namespace mus 134 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698