| 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..afee0f0b3376c5c5ccbe4eebec0ac07c3cd99d82 100644
|
| --- a/ash/mus/test/wm_test_base.cc
|
| +++ b/ash/mus/test/wm_test_base.cc
|
| @@ -123,6 +123,65 @@ ui::Window* WmTestBase::CreateTestWindow(const gfx::Rect& bounds,
|
| return window;
|
| }
|
|
|
| +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,
|
| + ui::wm::WindowType window_type,
|
| + RootWindowController* root) {
|
| + std::map<std::string, std::vector<uint8_t>> properties;
|
| + properties[ui::mojom::WindowManager::kWindowType_Property] =
|
| + mojo::ConvertTo<std::vector<uint8_t>>(
|
| + static_cast<int32_t>(MusWindowTypeFromWmWindowType(window_type)));
|
| + if (!bounds.IsEmpty()) {
|
| + properties[ui::mojom::WindowManager::kInitialBounds_Property] =
|
| + mojo::ConvertTo<std::vector<uint8_t>>(bounds);
|
| + }
|
| + properties[ui::mojom::WindowManager::kResizeBehavior_Property] =
|
| + mojo::ConvertTo<std::vector<uint8_t>>(
|
| + ui::mojom::kResizeBehaviorCanResize |
|
| + ui::mojom::kResizeBehaviorCanMaximize |
|
| + ui::mojom::kResizeBehaviorCanMinimize);
|
| +
|
| + properties[ui::mojom::WindowManager::kInitialDisplayId_Property] =
|
| + mojo::ConvertTo<std::vector<uint8_t>>(root->display().id());
|
| + // LOG(ERROR) << "\n WmTestBase::CreateTestWindow
|
| + // properties[ui::mojom::WindowManager::kInitialDisplayId_Property]=" <<
|
| + // mojo::TypeConverter<int64_t,
|
| + // std::vector<uint8_t>>::Convert(properties[ui::mojom::WindowManager::kInitialDisplayId_Property]);
|
| +
|
| + LOG(ERROR) << "\n root->display().id()" << root->display().id() << "\n";
|
| +
|
| + ui::Window* window = root->window_manager()->NewTopLevelWindow(&properties);
|
| + window->SetVisible(true);
|
| + // Most tests expect a minimum size of 0x0.
|
| + WmWindowMusTestApi(WmWindowMus::Get(window)).set_use_empty_minimum_size(true);
|
| + return window;
|
| +}
|
| +
|
| +ui::Window* WmTestBase::CreateFullscreenTestWindow(RootWindowController* root) {
|
| + 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());
|
| +
|
| + ui::Window* window = root->window_manager()->NewTopLevelWindow(&properties);
|
| + window->SetVisible(true);
|
| + return window;
|
| +}
|
| +
|
| ui::Window* WmTestBase::CreateFullscreenTestWindow() {
|
| std::map<std::string, std::vector<uint8_t>> properties;
|
| properties[ui::mojom::WindowManager::kShowState_Property] =
|
|
|