| Index: ash/mus/test/wm_test_base.cc
|
| diff --git a/mash/wm/test/wm_test_base.cc b/ash/mus/test/wm_test_base.cc
|
| similarity index 77%
|
| rename from mash/wm/test/wm_test_base.cc
|
| rename to ash/mus/test/wm_test_base.cc
|
| index 680efb7572ba3f996e38e9ecd69a5fd3dacc5ac2..f99703ce86b169c2ee8c7de08c8ced0db613e0d9 100644
|
| --- a/mash/wm/test/wm_test_base.cc
|
| +++ b/ash/mus/test/wm_test_base.cc
|
| @@ -2,53 +2,53 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "mash/wm/test/wm_test_base.h"
|
| +#include "ash/mus/test/wm_test_base.h"
|
|
|
| #include <algorithm>
|
| #include <vector>
|
|
|
| +#include "ash/mus/root_window_controller.h"
|
| +#include "ash/mus/test/wm_test_helper.h"
|
| +#include "ash/mus/test/wm_test_screen.h"
|
| +#include "ash/mus/window_manager.h"
|
| +#include "ash/mus/window_manager_application.h"
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/string_split.h"
|
| #include "components/mus/public/cpp/property_type_converters.h"
|
| #include "components/mus/public/cpp/window_tree_client.h"
|
| -#include "mash/wm/root_window_controller.h"
|
| -#include "mash/wm/test/wm_test_helper.h"
|
| -#include "mash/wm/test/wm_test_screen.h"
|
| -#include "mash/wm/window_manager.h"
|
| -#include "mash/wm/window_manager_application.h"
|
| #include "ui/display/display.h"
|
|
|
| -namespace mash {
|
| -namespace wm {
|
| +namespace ash {
|
| +namespace mus {
|
| namespace {
|
|
|
| -mus::mojom::WindowType MusWindowTypeFromWmWindowType(
|
| +::mus::mojom::WindowType MusWindowTypeFromWmWindowType(
|
| ui::wm::WindowType wm_window_type) {
|
| switch (wm_window_type) {
|
| case ui::wm::WINDOW_TYPE_UNKNOWN:
|
| break;
|
|
|
| case ui::wm::WINDOW_TYPE_NORMAL:
|
| - return mus::mojom::WindowType::WINDOW;
|
| + return ::mus::mojom::WindowType::WINDOW;
|
|
|
| case ui::wm::WINDOW_TYPE_POPUP:
|
| - return mus::mojom::WindowType::POPUP;
|
| + return ::mus::mojom::WindowType::POPUP;
|
|
|
| case ui::wm::WINDOW_TYPE_CONTROL:
|
| - return mus::mojom::WindowType::CONTROL;
|
| + return ::mus::mojom::WindowType::CONTROL;
|
|
|
| case ui::wm::WINDOW_TYPE_PANEL:
|
| - return mus::mojom::WindowType::PANEL;
|
| + return ::mus::mojom::WindowType::PANEL;
|
|
|
| case ui::wm::WINDOW_TYPE_MENU:
|
| - return mus::mojom::WindowType::MENU;
|
| + return ::mus::mojom::WindowType::MENU;
|
|
|
| case ui::wm::WINDOW_TYPE_TOOLTIP:
|
| - return mus::mojom::WindowType::TOOLTIP;
|
| + return ::mus::mojom::WindowType::TOOLTIP;
|
| }
|
|
|
| NOTREACHED();
|
| - return mus::mojom::WindowType::CONTROL;
|
| + return ::mus::mojom::WindowType::CONTROL;
|
| }
|
|
|
| bool CompareByDisplayId(const RootWindowController* root1,
|
| @@ -120,14 +120,14 @@ void WmTestBase::UpdateDisplay(const std::string& display_spec) {
|
| roots[0]->display(), views::DisplayList::Type::PRIMARY);
|
| }
|
|
|
| -mus::Window* WmTestBase::GetPrimaryRootWindow() {
|
| +::mus::Window* WmTestBase::GetPrimaryRootWindow() {
|
| std::vector<RootWindowController*> roots =
|
| WmTestBase::GetRootsOrderedByDisplayId();
|
| DCHECK(!roots.empty());
|
| return roots[0]->root();
|
| }
|
|
|
| -mus::Window* WmTestBase::GetSecondaryRootWindow() {
|
| +::mus::Window* WmTestBase::GetSecondaryRootWindow() {
|
| std::vector<RootWindowController*> roots =
|
| WmTestBase::GetRootsOrderedByDisplayId();
|
| return roots.size() < 2 ? nullptr : roots[1]->root();
|
| @@ -146,40 +146,40 @@ display::Display WmTestBase::GetSecondaryDisplay() {
|
| return roots.size() < 2 ? display::Display() : roots[1]->display();
|
| }
|
|
|
| -mus::Window* WmTestBase::CreateTestWindow(const gfx::Rect& bounds) {
|
| +::mus::Window* WmTestBase::CreateTestWindow(const gfx::Rect& bounds) {
|
| return CreateTestWindow(bounds, ui::wm::WINDOW_TYPE_NORMAL);
|
| }
|
|
|
| -mus::Window* WmTestBase::CreateTestWindow(const gfx::Rect& bounds,
|
| - ui::wm::WindowType window_type) {
|
| +::mus::Window* WmTestBase::CreateTestWindow(const gfx::Rect& bounds,
|
| + ui::wm::WindowType window_type) {
|
| std::map<std::string, std::vector<uint8_t>> properties;
|
| - properties[mus::mojom::WindowManager::kWindowType_Property] =
|
| + properties[::mus::mojom::WindowManager::kWindowType_Property] =
|
| mojo::ConvertTo<std::vector<uint8_t>>(
|
| static_cast<int32_t>(MusWindowTypeFromWmWindowType(window_type)));
|
| if (!bounds.IsEmpty()) {
|
| - properties[mus::mojom::WindowManager::kInitialBounds_Property] =
|
| + properties[::mus::mojom::WindowManager::kInitialBounds_Property] =
|
| mojo::ConvertTo<std::vector<uint8_t>>(bounds);
|
| }
|
| - properties[mus::mojom::WindowManager::kResizeBehavior_Property] =
|
| + properties[::mus::mojom::WindowManager::kResizeBehavior_Property] =
|
| mojo::ConvertTo<std::vector<uint8_t>>(
|
| - mus::mojom::kResizeBehaviorCanResize |
|
| - mus::mojom::kResizeBehaviorCanMaximize |
|
| - mus::mojom::kResizeBehaviorCanMinimize);
|
| + ::mus::mojom::kResizeBehaviorCanResize |
|
| + ::mus::mojom::kResizeBehaviorCanMaximize |
|
| + ::mus::mojom::kResizeBehaviorCanMinimize);
|
|
|
| - mus::Window* window =
|
| + ::mus::Window* window =
|
| GetRootsOrderedByDisplayId()[0]->window_manager()->NewTopLevelWindow(
|
| &properties);
|
| window->SetVisible(true);
|
| return window;
|
| }
|
|
|
| -mus::Window* WmTestBase::CreateChildTestWindow(mus::Window* parent,
|
| - const gfx::Rect& bounds) {
|
| +::mus::Window* WmTestBase::CreateChildTestWindow(::mus::Window* parent,
|
| + const gfx::Rect& bounds) {
|
| std::map<std::string, std::vector<uint8_t>> properties;
|
| - properties[mus::mojom::WindowManager::kWindowType_Property] =
|
| + properties[::mus::mojom::WindowManager::kWindowType_Property] =
|
| mojo::ConvertTo<std::vector<uint8_t>>(static_cast<int32_t>(
|
| MusWindowTypeFromWmWindowType(ui::wm::WINDOW_TYPE_NORMAL)));
|
| - mus::Window* window =
|
| + ::mus::Window* window =
|
| GetRootsOrderedByDisplayId()[0]->root()->window_tree()->NewWindow(
|
| &properties);
|
| window->SetBounds(bounds);
|
| @@ -208,5 +208,5 @@ std::vector<RootWindowController*> WmTestBase::GetRootsOrderedByDisplayId() {
|
| return ordered_roots;
|
| }
|
|
|
| -} // namespace wm
|
| -} // namespace mash
|
| +} // namespace mus
|
| +} // namespace ash
|
|
|