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" | |
9 #include "ash/common/test/wm_shell_test_api.h" | 7 #include "ash/common/test/wm_shell_test_api.h" |
10 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
11 #include "ash/common/wm_window.h" | 9 #include "ash/common/wm_window.h" |
12 #include "ash/mus/screen_mus.h" | 10 #include "ash/mus/screen_mus.h" |
13 #include "ash/mus/window_manager.h" | 11 #include "ash/mus/window_manager.h" |
14 #include "ash/mus/window_manager_application.h" | 12 #include "ash/mus/window_manager_application.h" |
15 #include "ash/test/test_shell_delegate.h" | 13 #include "ash/test/test_shell_delegate.h" |
16 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
17 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
18 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 WmTestHelper::WmTestHelper() {} | 73 WmTestHelper::WmTestHelper() {} |
76 | 74 |
77 WmTestHelper::~WmTestHelper() { | 75 WmTestHelper::~WmTestHelper() { |
78 // Needs to be destroyed before material design. | 76 // Needs to be destroyed before material design. |
79 window_manager_app_.reset(); | 77 window_manager_app_.reset(); |
80 | 78 |
81 base::RunLoop().RunUntilIdle(); | 79 base::RunLoop().RunUntilIdle(); |
82 blocking_pool_owner_.reset(); | 80 blocking_pool_owner_.reset(); |
83 base::RunLoop().RunUntilIdle(); | 81 base::RunLoop().RunUntilIdle(); |
84 | 82 |
85 ash::test::MaterialDesignControllerTestAPI::Uninitialize(); | |
86 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); | 83 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); |
87 } | 84 } |
88 | 85 |
89 void WmTestHelper::Init() { | 86 void WmTestHelper::Init() { |
90 ui::MaterialDesignController::Initialize(); | 87 ui::MaterialDesignController::Initialize(); |
91 ash::MaterialDesignController::Initialize(); | |
92 | 88 |
93 views_delegate_ = base::MakeUnique<views::TestViewsDelegate>(); | 89 views_delegate_ = base::MakeUnique<views::TestViewsDelegate>(); |
94 | 90 |
95 window_manager_app_ = base::MakeUnique<WindowManagerApplication>(); | 91 window_manager_app_ = base::MakeUnique<WindowManagerApplication>(); |
96 | 92 |
97 message_loop_.reset(new base::MessageLoopForUI()); | 93 message_loop_.reset(new base::MessageLoopForUI()); |
98 | 94 |
99 const size_t kMaxNumberThreads = 3u; // Matches that of content. | 95 const size_t kMaxNumberThreads = 3u; // Matches that of content. |
100 const char kThreadNamePrefix[] = "MashBlockingForTesting"; | 96 const char kThreadNamePrefix[] = "MashBlockingForTesting"; |
101 blocking_pool_owner_ = base::MakeUnique<base::SequencedWorkerPoolOwner>( | 97 blocking_pool_owner_ = base::MakeUnique<base::SequencedWorkerPoolOwner>( |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 const bool is_primary = | 182 const bool is_primary = |
187 screen->display_list().FindDisplayById(updated_display.id()) == | 183 screen->display_list().FindDisplayById(updated_display.id()) == |
188 screen->display_list().GetPrimaryDisplayIterator(); | 184 screen->display_list().GetPrimaryDisplayIterator(); |
189 screen->display_list().UpdateDisplay( | 185 screen->display_list().UpdateDisplay( |
190 updated_display, is_primary ? display::DisplayList::Type::PRIMARY | 186 updated_display, is_primary ? display::DisplayList::Type::PRIMARY |
191 : display::DisplayList::Type::NOT_PRIMARY); | 187 : display::DisplayList::Type::NOT_PRIMARY); |
192 } | 188 } |
193 | 189 |
194 } // namespace mus | 190 } // namespace mus |
195 } // namespace ash | 191 } // namespace ash |
OLD | NEW |