Chromium Code Reviews| Index: ash/mus/test/wm_test_base.cc |
| diff --git a/ash/mus/test/wm_test_base.cc b/ash/mus/test/wm_test_base.cc |
| index c45eb6e73457fd27f8e573754940c7f90f90f533..5f7008870bbf9dd3ae2f106906029aace5f275ee 100644 |
| --- a/ash/mus/test/wm_test_base.cc |
| +++ b/ash/mus/test/wm_test_base.cc |
| @@ -94,6 +94,19 @@ display::Display WmTestBase::GetSecondaryDisplay() { |
| return roots.size() < 2 ? display::Display() : roots[1]->display(); |
| } |
| +RootWindowController* WmTestBase::GetPrimaryRootWindowController() { |
| + std::vector<RootWindowController*> roots = |
| + test_helper_->GetRootsOrderedByDisplayId(); |
| + DCHECK(!roots.empty()); |
| + return roots[0]; |
| +} |
| + |
| +RootWindowController* WmTestBase::GetSecondaryRootWindowController() { |
| + std::vector<RootWindowController*> roots = |
| + test_helper_->GetRootsOrderedByDisplayId(); |
| + return roots.size() < 2 ? nullptr : roots[1]; |
| +} |
| + |
| ui::Window* WmTestBase::CreateTestWindow(const gfx::Rect& bounds) { |
| return CreateTestWindow(bounds, ui::wm::WINDOW_TYPE_NORMAL); |
| } |
| @@ -123,14 +136,22 @@ ui::Window* WmTestBase::CreateTestWindow(const gfx::Rect& bounds, |
| return window; |
| } |
| -ui::Window* WmTestBase::CreateFullscreenTestWindow() { |
| +ui::Window* WmTestBase::CreateFullscreenTestWindow( |
| + RootWindowController* root = nullptr) { |
| std::map<std::string, std::vector<uint8_t>> properties; |
| properties[ui::mojom::WindowManager::kShowState_Property] = |
| mojo::ConvertTo<std::vector<uint8_t>>( |
| static_cast<int32_t>(ui::mojom::ShowState::FULLSCREEN)); |
| - ui::Window* window = test_helper_->GetRootsOrderedByDisplayId()[0] |
| - ->window_manager() |
| - ->NewTopLevelWindow(&properties); |
| + |
| + ui::Window* window = nullptr; |
| + if (root) { |
| + properties[ui::mojom::WindowManager::kInitialDisplayId_Property] = |
| + mojo::ConvertTo<std::vector<uint8_t>>(root->display().id()); |
| + window = root->window_manager()->NewTopLevelWindow(&properties); |
|
mfomitchev
2016/11/18 20:35:58
I think window manager is the same for all root wi
thanhph
2016/11/18 20:53:08
Great stuff here Mikhail, thanks! The WM is the sa
|
| + } else |
| + window = test_helper_->GetRootsOrderedByDisplayId()[0] |
| + ->window_manager() |
| + ->NewTopLevelWindow(&properties); |
| window->SetVisible(true); |
| return window; |
| } |