OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/shell.h" | 5 #include "ash/shell.h" |
6 #include "ash/test/ash_test_base.h" | 6 #include "ash/test/ash_test_base.h" |
7 #include "ash/test/test_session_state_delegate.h" | 7 #include "ash/test/test_session_state_delegate.h" |
8 #include "ash/test/test_shell_delegate.h" | 8 #include "ash/test/test_shell_delegate.h" |
9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "chrome/browser/chromeos/extensions/wallpaper_private_api.h" | 12 #include "chrome/browser/chromeos/extensions/wallpaper_private_api.h" |
13 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" | 13 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
14 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 14 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
| 15 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
15 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 16 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
16 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" | 17 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" |
17 #include "ui/aura/test/test_windows.h" | 18 #include "ui/aura/test/test_windows.h" |
18 #include "ui/aura/window.h" | 19 #include "ui/aura/window.h" |
19 #include "ui/aura/window_event_dispatcher.h" | 20 #include "ui/aura/window_event_dispatcher.h" |
20 | 21 |
21 namespace chromeos { | 22 namespace chromeos { |
22 namespace { | 23 namespace { |
23 | 24 |
24 const char kTestAccount1[] = "user1@test.com"; | 25 const char kTestAccount1[] = "user1@test.com"; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 197 |
197 private: | 198 private: |
198 chrome::MultiUserWindowManagerChromeOS* multi_user_window_manager_; | 199 chrome::MultiUserWindowManagerChromeOS* multi_user_window_manager_; |
199 ash::test::TestSessionStateDelegate* session_state_delegate_; | 200 ash::test::TestSessionStateDelegate* session_state_delegate_; |
200 | 201 |
201 DISALLOW_COPY_AND_ASSIGN(WallpaperPrivateApiMultiUserUnittest); | 202 DISALLOW_COPY_AND_ASSIGN(WallpaperPrivateApiMultiUserUnittest); |
202 }; | 203 }; |
203 | 204 |
204 void WallpaperPrivateApiMultiUserUnittest::SetUp() { | 205 void WallpaperPrivateApiMultiUserUnittest::SetUp() { |
205 AshTestBase::SetUp(); | 206 AshTestBase::SetUp(); |
| 207 WallpaperManager::Initialize(); |
206 session_state_delegate_ = | 208 session_state_delegate_ = |
207 static_cast<ash::test::TestSessionStateDelegate*> ( | 209 static_cast<ash::test::TestSessionStateDelegate*> ( |
208 ash::Shell::GetInstance()->session_state_delegate()); | 210 ash::Shell::GetInstance()->session_state_delegate()); |
209 fake_user_manager()->AddUser(kTestAccount1); | 211 fake_user_manager()->AddUser(kTestAccount1); |
210 fake_user_manager()->AddUser(kTestAccount2); | 212 fake_user_manager()->AddUser(kTestAccount2); |
211 } | 213 } |
212 | 214 |
213 void WallpaperPrivateApiMultiUserUnittest::TearDown() { | 215 void WallpaperPrivateApiMultiUserUnittest::TearDown() { |
214 chrome::MultiUserWindowManager::DeleteInstance(); | 216 chrome::MultiUserWindowManager::DeleteInstance(); |
215 AshTestBase::TearDown(); | 217 AshTestBase::TearDown(); |
| 218 WallpaperManager::Shutdown(); |
216 } | 219 } |
217 | 220 |
218 void WallpaperPrivateApiMultiUserUnittest::SetUpMultiUserWindowManager( | 221 void WallpaperPrivateApiMultiUserUnittest::SetUpMultiUserWindowManager( |
219 const std::string& active_user_id, | 222 const std::string& active_user_id, |
220 chrome::MultiUserWindowManager::MultiProfileMode mode) { | 223 chrome::MultiUserWindowManager::MultiProfileMode mode) { |
221 multi_user_window_manager_ = | 224 multi_user_window_manager_ = |
222 new chrome::MultiUserWindowManagerChromeOS(active_user_id); | 225 new chrome::MultiUserWindowManagerChromeOS(active_user_id); |
223 multi_user_window_manager_->Init(); | 226 multi_user_window_manager_->Init(); |
224 chrome::MultiUserWindowManager::SetInstanceForTest( | 227 chrome::MultiUserWindowManager::SetInstanceForTest( |
225 multi_user_window_manager_, mode); | 228 multi_user_window_manager_, mode); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 scoped_refptr<TestRestoreFunction> restore_function_1( | 393 scoped_refptr<TestRestoreFunction> restore_function_1( |
391 new TestRestoreFunction()); | 394 new TestRestoreFunction()); |
392 EXPECT_TRUE(restore_function_1->RunAsync()); | 395 EXPECT_TRUE(restore_function_1->RunAsync()); |
393 | 396 |
394 EXPECT_FALSE(window1_state->IsMinimized()); | 397 EXPECT_FALSE(window1_state->IsMinimized()); |
395 EXPECT_FALSE(window2_state->IsMinimized()); | 398 EXPECT_FALSE(window2_state->IsMinimized()); |
396 EXPECT_FALSE(window3_state->IsMinimized()); | 399 EXPECT_FALSE(window3_state->IsMinimized()); |
397 } | 400 } |
398 | 401 |
399 } // namespace chromeos | 402 } // namespace chromeos |
OLD | NEW |