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..ea5401f2acca6ef9fb34c91ac36be3e6f71c9533 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]; |
|
mfomitchev
2016/11/18 17:36:24
The current code doesn't seem to account for the p
thanhph
2016/11/18 19:15:44
I get this idea from the function ui::Window* WmTe
|
| +} |
| + |
| ui::Window* WmTestBase::CreateTestWindow(const gfx::Rect& bounds) { |
| return CreateTestWindow(bounds, ui::wm::WINDOW_TYPE_NORMAL); |
| } |
| @@ -135,6 +148,22 @@ ui::Window* WmTestBase::CreateFullscreenTestWindow() { |
| return window; |
| } |
| +ui::Window* WmTestBase::CreateFullscreenTestWindow(RootWindowController* root) { |
|
mfomitchev
2016/11/18 17:36:24
Avoid duplicate code between this and the above me
thanhph
2016/11/18 19:15:44
I merged the codes in 2 functions. Thanks!
|
| + 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)); |
| + properties[ui::mojom::WindowManager::kInitialDisplayId_Property] = |
| + mojo::ConvertTo<std::vector<uint8_t>>(root->display().id()); |
| + |
| + // properties[ui::mojom::WindowManager::kInitialContainerId_Property] = |
|
mfomitchev
2016/11/18 17:36:24
remove
thanhph
2016/11/18 19:15:44
Done.
|
| + // mojo::ConvertTo<std::vector<uint8_t>>(root->display().id()); |
| + |
| + ui::Window* window = root->window_manager()->NewTopLevelWindow(&properties); |
| + window->SetVisible(true); |
| + return window; |
| +} |
| + |
| ui::Window* WmTestBase::CreateChildTestWindow(ui::Window* parent, |
| const gfx::Rect& bounds) { |
| std::map<std::string, std::vector<uint8_t>> properties; |