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_helper.h" | 5 #include "ash/mus/test/wm_test_helper.h" |
6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/test/material_design_controller_test_api.h" |
7 #include "ash/mus/root_window_controller.h" | 9 #include "ash/mus/root_window_controller.h" |
8 #include "ash/mus/test/wm_test_screen.h" | 10 #include "ash/mus/test/wm_test_screen.h" |
9 #include "ash/mus/window_manager.h" | 11 #include "ash/mus/window_manager.h" |
10 #include "ash/mus/window_manager_application.h" | 12 #include "ash/mus/window_manager_application.h" |
11 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
12 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
13 #include "services/ui/public/cpp/property_type_converters.h" | 15 #include "services/ui/public/cpp/property_type_converters.h" |
14 #include "services/ui/public/cpp/tests/window_tree_client_private.h" | 16 #include "services/ui/public/cpp/tests/window_tree_client_private.h" |
15 #include "services/ui/public/cpp/window_tree_client.h" | 17 #include "services/ui/public/cpp/window_tree_client.h" |
| 18 #include "ui/base/material_design/material_design_controller.h" |
| 19 #include "ui/base/test/material_design_controller_test_api.h" |
16 #include "ui/display/display.h" | 20 #include "ui/display/display.h" |
17 | 21 |
18 namespace ash { | 22 namespace ash { |
19 namespace mus { | 23 namespace mus { |
20 | 24 |
21 WmTestHelper::WmTestHelper() {} | 25 WmTestHelper::WmTestHelper() {} |
22 | 26 |
23 WmTestHelper::~WmTestHelper() {} | 27 WmTestHelper::~WmTestHelper() { |
| 28 ash::test::MaterialDesignControllerTestAPI::Uninitialize(); |
| 29 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); |
| 30 } |
24 | 31 |
25 void WmTestHelper::Init() { | 32 void WmTestHelper::Init() { |
| 33 ui::MaterialDesignController::Initialize(); |
| 34 ash::MaterialDesignController::Initialize(); |
| 35 |
26 message_loop_.reset(new base::MessageLoopForUI()); | 36 message_loop_.reset(new base::MessageLoopForUI()); |
27 window_manager_app_.window_manager_.reset(new WindowManager(nullptr)); | 37 window_manager_app_.window_manager_.reset(new WindowManager(nullptr)); |
28 screen_ = new WmTestScreen; | 38 screen_ = new WmTestScreen; |
29 window_manager_app_.window_manager_->screen_.reset(screen_); | 39 window_manager_app_.window_manager_->screen_.reset(screen_); |
30 | 40 |
31 // Need an id other than kInvalidDisplayID so the Display is considered valid. | 41 // Need an id other than kInvalidDisplayID so the Display is considered valid. |
32 display::Display display(1); | 42 display::Display display(1); |
33 const gfx::Rect display_bounds(0, 0, 800, 600); | 43 const gfx::Rect display_bounds(0, 0, 800, 600); |
34 display.set_bounds(display_bounds); | 44 display.set_bounds(display_bounds); |
35 // Offset the height slightly to give a different work area. -20 is arbitrary, | 45 // Offset the height slightly to give a different work area. -20 is arbitrary, |
(...skipping 10 matching lines...) Expand all Loading... |
46 | 56 |
47 screen_->display_list()->AddDisplay(display, | 57 screen_->display_list()->AddDisplay(display, |
48 views::DisplayList::Type::PRIMARY); | 58 views::DisplayList::Type::PRIMARY); |
49 | 59 |
50 ui::WindowTreeClientPrivate(window_tree_client_setup_.window_tree_client()) | 60 ui::WindowTreeClientPrivate(window_tree_client_setup_.window_tree_client()) |
51 .CallWmNewDisplayAdded(display); | 61 .CallWmNewDisplayAdded(display); |
52 } | 62 } |
53 | 63 |
54 } // namespace mus | 64 } // namespace mus |
55 } // namespace ash | 65 } // namespace ash |
OLD | NEW |