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/test/wm_shell_test_api.h" | 7 #include "ash/common/test/wm_shell_test_api.h" |
8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
9 #include "ash/common/wm_window.h" | 9 #include "ash/common/wm_window.h" |
10 #include "ash/mus/screen_mus.h" | 10 #include "ash/mus/screen_mus.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 window_manager_app_.reset(); | 77 window_manager_app_.reset(); |
78 | 78 |
79 base::RunLoop().RunUntilIdle(); | 79 base::RunLoop().RunUntilIdle(); |
80 blocking_pool_owner_.reset(); | 80 blocking_pool_owner_.reset(); |
81 base::RunLoop().RunUntilIdle(); | 81 base::RunLoop().RunUntilIdle(); |
82 | 82 |
83 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); | 83 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); |
84 } | 84 } |
85 | 85 |
86 void WmTestHelper::Init() { | 86 void WmTestHelper::Init() { |
| 87 // MaterialDesignController may have already been initialized. To cover that |
| 88 // case explicitly uninitialize before initializing. |
| 89 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); |
87 ui::MaterialDesignController::Initialize(); | 90 ui::MaterialDesignController::Initialize(); |
88 | 91 |
89 views_delegate_ = base::MakeUnique<views::TestViewsDelegate>(); | 92 views_delegate_ = base::MakeUnique<views::TestViewsDelegate>(); |
90 | 93 |
91 window_manager_app_ = base::MakeUnique<WindowManagerApplication>(); | 94 window_manager_app_ = base::MakeUnique<WindowManagerApplication>(); |
92 | 95 |
93 message_loop_.reset(new base::MessageLoopForUI()); | 96 message_loop_.reset(new base::MessageLoopForUI()); |
94 | 97 |
95 const size_t kMaxNumberThreads = 3u; // Matches that of content. | 98 const size_t kMaxNumberThreads = 3u; // Matches that of content. |
96 const char kThreadNamePrefix[] = "MashBlockingForTesting"; | 99 const char kThreadNamePrefix[] = "MashBlockingForTesting"; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 const bool is_primary = | 185 const bool is_primary = |
183 screen->display_list().FindDisplayById(updated_display.id()) == | 186 screen->display_list().FindDisplayById(updated_display.id()) == |
184 screen->display_list().GetPrimaryDisplayIterator(); | 187 screen->display_list().GetPrimaryDisplayIterator(); |
185 screen->display_list().UpdateDisplay( | 188 screen->display_list().UpdateDisplay( |
186 updated_display, is_primary ? display::DisplayList::Type::PRIMARY | 189 updated_display, is_primary ? display::DisplayList::Type::PRIMARY |
187 : display::DisplayList::Type::NOT_PRIMARY); | 190 : display::DisplayList::Type::NOT_PRIMARY); |
188 } | 191 } |
189 | 192 |
190 } // namespace mus | 193 } // namespace mus |
191 } // namespace ash | 194 } // namespace ash |
OLD | NEW |