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

Side by Side Diff: ash/mus/test/wm_test_base.cc

Issue 2503623002: Support creation of toplevel mus::Windows on separate displays (Closed)
Patch Set: Remove GetPrimary/SecondaryRootWindowController methods. 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
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 "ash/mus/test/wm_test_base.h" 5 #include "ash/mus/test/wm_test_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/mus/bridge/wm_window_mus_test_api.h" 10 #include "ash/mus/bridge/wm_window_mus_test_api.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 ui::Window* window = test_helper_->GetRootsOrderedByDisplayId()[0] 117 ui::Window* window = test_helper_->GetRootsOrderedByDisplayId()[0]
118 ->window_manager() 118 ->window_manager()
119 ->NewTopLevelWindow(&properties); 119 ->NewTopLevelWindow(&properties);
120 window->SetVisible(true); 120 window->SetVisible(true);
121 // Most tests expect a minimum size of 0x0. 121 // Most tests expect a minimum size of 0x0.
122 WmWindowMusTestApi(WmWindowMus::Get(window)).set_use_empty_minimum_size(true); 122 WmWindowMusTestApi(WmWindowMus::Get(window)).set_use_empty_minimum_size(true);
123 return window; 123 return window;
124 } 124 }
125 125
126 ui::Window* WmTestBase::CreateFullscreenTestWindow() { 126 ui::Window* WmTestBase::CreateFullscreenTestWindow(int64_t display_id = 0) {
127 std::map<std::string, std::vector<uint8_t>> properties; 127 std::map<std::string, std::vector<uint8_t>> properties;
128 properties[ui::mojom::WindowManager::kShowState_Property] = 128 properties[ui::mojom::WindowManager::kShowState_Property] =
129 mojo::ConvertTo<std::vector<uint8_t>>( 129 mojo::ConvertTo<std::vector<uint8_t>>(
130 static_cast<int32_t>(ui::mojom::ShowState::FULLSCREEN)); 130 static_cast<int32_t>(ui::mojom::ShowState::FULLSCREEN));
131
132 if (display_id)
mfomitchev 2016/11/18 21:23:40 Need braces around multiline statement.
thanhph 2016/11/21 14:37:53 Done.
133 properties[ui::mojom::WindowManager::kInitialDisplayId_Property] =
134 mojo::ConvertTo<std::vector<uint8_t>>(display_id);
mfomitchev 2016/11/18 21:23:40 Is 0 display id guaranteed to be the same as havin
thanhph 2016/11/21 14:37:53 Done. I change from 0 to display::Display::kInvali
mfomitchev 2016/11/22 22:53:16 Wait, this is different. Now we can't call this me
135
131 ui::Window* window = test_helper_->GetRootsOrderedByDisplayId()[0] 136 ui::Window* window = test_helper_->GetRootsOrderedByDisplayId()[0]
132 ->window_manager() 137 ->window_manager()
133 ->NewTopLevelWindow(&properties); 138 ->NewTopLevelWindow(&properties);
134 window->SetVisible(true); 139 window->SetVisible(true);
135 return window; 140 return window;
136 } 141 }
137 142
138 ui::Window* WmTestBase::CreateChildTestWindow(ui::Window* parent, 143 ui::Window* WmTestBase::CreateChildTestWindow(ui::Window* parent,
139 const gfx::Rect& bounds) { 144 const gfx::Rect& bounds) {
140 std::map<std::string, std::vector<uint8_t>> properties; 145 std::map<std::string, std::vector<uint8_t>> properties;
(...skipping 16 matching lines...) Expand all
157 test_helper_->Init(); 162 test_helper_->Init();
158 } 163 }
159 164
160 void WmTestBase::TearDown() { 165 void WmTestBase::TearDown() {
161 teardown_called_ = true; 166 teardown_called_ = true;
162 test_helper_.reset(); 167 test_helper_.reset();
163 } 168 }
164 169
165 } // namespace mus 170 } // namespace mus
166 } // namespace ash 171 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698