OLD | NEW |
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/root_window_controller.h" | 11 #include "ash/mus/root_window_controller.h" |
11 #include "ash/mus/test/wm_test_helper.h" | 12 #include "ash/mus/test/wm_test_helper.h" |
12 #include "ash/mus/window_manager.h" | 13 #include "ash/mus/window_manager.h" |
13 #include "ash/mus/window_manager_application.h" | 14 #include "ash/mus/window_manager_application.h" |
14 #include "services/ui/public/cpp/property_type_converters.h" | 15 #include "services/ui/public/cpp/property_type_converters.h" |
15 #include "services/ui/public/cpp/window_tree_client.h" | 16 #include "services/ui/public/cpp/window_tree_client.h" |
16 #include "ui/display/display.h" | 17 #include "ui/display/display.h" |
17 | 18 |
18 namespace ash { | 19 namespace ash { |
19 namespace mus { | 20 namespace mus { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 properties[ui::mojom::WindowManager::kResizeBehavior_Property] = | 111 properties[ui::mojom::WindowManager::kResizeBehavior_Property] = |
111 mojo::ConvertTo<std::vector<uint8_t>>( | 112 mojo::ConvertTo<std::vector<uint8_t>>( |
112 ui::mojom::kResizeBehaviorCanResize | | 113 ui::mojom::kResizeBehaviorCanResize | |
113 ui::mojom::kResizeBehaviorCanMaximize | | 114 ui::mojom::kResizeBehaviorCanMaximize | |
114 ui::mojom::kResizeBehaviorCanMinimize); | 115 ui::mojom::kResizeBehaviorCanMinimize); |
115 | 116 |
116 ui::Window* window = test_helper_->GetRootsOrderedByDisplayId()[0] | 117 ui::Window* window = test_helper_->GetRootsOrderedByDisplayId()[0] |
117 ->window_manager() | 118 ->window_manager() |
118 ->NewTopLevelWindow(&properties); | 119 ->NewTopLevelWindow(&properties); |
119 window->SetVisible(true); | 120 window->SetVisible(true); |
| 121 // Most tests expect a minimum size of 0x0. |
| 122 WmWindowMusTestApi(WmWindowMus::Get(window)).set_use_empty_minimum_size(true); |
120 return window; | 123 return window; |
121 } | 124 } |
122 | 125 |
123 ui::Window* WmTestBase::CreateFullscreenTestWindow() { | 126 ui::Window* WmTestBase::CreateFullscreenTestWindow() { |
124 std::map<std::string, std::vector<uint8_t>> properties; | 127 std::map<std::string, std::vector<uint8_t>> properties; |
125 properties[ui::mojom::WindowManager::kShowState_Property] = | 128 properties[ui::mojom::WindowManager::kShowState_Property] = |
126 mojo::ConvertTo<std::vector<uint8_t>>( | 129 mojo::ConvertTo<std::vector<uint8_t>>( |
127 static_cast<int32_t>(ui::mojom::ShowState::FULLSCREEN)); | 130 static_cast<int32_t>(ui::mojom::ShowState::FULLSCREEN)); |
128 ui::Window* window = test_helper_->GetRootsOrderedByDisplayId()[0] | 131 ui::Window* window = test_helper_->GetRootsOrderedByDisplayId()[0] |
129 ->window_manager() | 132 ->window_manager() |
(...skipping 24 matching lines...) Expand all Loading... |
154 test_helper_->Init(); | 157 test_helper_->Init(); |
155 } | 158 } |
156 | 159 |
157 void WmTestBase::TearDown() { | 160 void WmTestBase::TearDown() { |
158 teardown_called_ = true; | 161 teardown_called_ = true; |
159 test_helper_.reset(); | 162 test_helper_.reset(); |
160 } | 163 } |
161 | 164 |
162 } // namespace mus | 165 } // namespace mus |
163 } // namespace ash | 166 } // namespace ash |
OLD | NEW |