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

Side by Side Diff: mash/wm/test/wm_test_base.cc

Issue 2018823002: Eliminate WindowTreeConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@connection
Patch Set: . Created 4 years, 6 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
« no previous file with comments | « mash/wm/test/wm_test_base.h ('k') | mash/wm/test/wm_test_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "mash/wm/test/wm_test_base.h" 5 #include "mash/wm/test/wm_test_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/strings/string_split.h" 11 #include "base/strings/string_split.h"
12 #include "components/mus/public/cpp/property_type_converters.h" 12 #include "components/mus/public/cpp/property_type_converters.h"
13 #include "components/mus/public/cpp/window_tree_connection.h" 13 #include "components/mus/public/cpp/window_tree_client.h"
14 #include "mash/wm/root_window_controller.h" 14 #include "mash/wm/root_window_controller.h"
15 #include "mash/wm/test/wm_test_helper.h" 15 #include "mash/wm/test/wm_test_helper.h"
16 #include "mash/wm/test/wm_test_screen.h" 16 #include "mash/wm/test/wm_test_screen.h"
17 #include "mash/wm/window_manager.h" 17 #include "mash/wm/window_manager.h"
18 #include "mash/wm/window_manager_application.h" 18 #include "mash/wm/window_manager_application.h"
19 #include "ui/display/display.h" 19 #include "ui/display/display.h"
20 20
21 namespace mash { 21 namespace mash {
22 namespace wm { 22 namespace wm {
23 namespace { 23 namespace {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 return window; 173 return window;
174 } 174 }
175 175
176 mus::Window* WmTestBase::CreateChildTestWindow(mus::Window* parent, 176 mus::Window* WmTestBase::CreateChildTestWindow(mus::Window* parent,
177 const gfx::Rect& bounds) { 177 const gfx::Rect& bounds) {
178 std::map<std::string, std::vector<uint8_t>> properties; 178 std::map<std::string, std::vector<uint8_t>> properties;
179 properties[mus::mojom::WindowManager::kWindowType_Property] = 179 properties[mus::mojom::WindowManager::kWindowType_Property] =
180 mojo::ConvertTo<std::vector<uint8_t>>(static_cast<int32_t>( 180 mojo::ConvertTo<std::vector<uint8_t>>(static_cast<int32_t>(
181 MusWindowTypeFromWmWindowType(ui::wm::WINDOW_TYPE_NORMAL))); 181 MusWindowTypeFromWmWindowType(ui::wm::WINDOW_TYPE_NORMAL)));
182 mus::Window* window = 182 mus::Window* window =
183 GetRootsOrderedByDisplayId()[0]->root()->connection()->NewWindow( 183 GetRootsOrderedByDisplayId()[0]->root()->window_tree()->NewWindow(
184 &properties); 184 &properties);
185 window->SetBounds(bounds); 185 window->SetBounds(bounds);
186 window->SetVisible(true); 186 window->SetVisible(true);
187 parent->AddChild(window); 187 parent->AddChild(window);
188 return window; 188 return window;
189 } 189 }
190 190
191 void WmTestBase::SetUp() { 191 void WmTestBase::SetUp() {
192 setup_called_ = true; 192 setup_called_ = true;
193 test_helper_.reset(new WmTestHelper); 193 test_helper_.reset(new WmTestHelper);
194 test_helper_->Init(); 194 test_helper_->Init();
195 } 195 }
196 196
197 void WmTestBase::TearDown() { 197 void WmTestBase::TearDown() {
198 teardown_called_ = true; 198 teardown_called_ = true;
199 test_helper_.reset(); 199 test_helper_.reset();
200 } 200 }
201 201
202 std::vector<RootWindowController*> WmTestBase::GetRootsOrderedByDisplayId() { 202 std::vector<RootWindowController*> WmTestBase::GetRootsOrderedByDisplayId() {
203 std::set<RootWindowController*> roots = 203 std::set<RootWindowController*> roots =
204 test_helper_->window_manager_app()->GetRootControllers(); 204 test_helper_->window_manager_app()->GetRootControllers();
205 std::vector<RootWindowController*> ordered_roots; 205 std::vector<RootWindowController*> ordered_roots;
206 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end()); 206 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end());
207 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId); 207 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId);
208 return ordered_roots; 208 return ordered_roots;
209 } 209 }
210 210
211 } // namespace wm 211 } // namespace wm
212 } // namespace mash 212 } // namespace mash
OLDNEW
« no previous file with comments | « mash/wm/test/wm_test_base.h ('k') | mash/wm/test/wm_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698