| 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_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/ui/ash/multi_user/multi_user_window_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_chromeos.h" | 16 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" |
| 17 #include "ui/aura/test/test_windows.h" | 17 #include "ui/aura/test/test_windows.h" |
| 18 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
| 19 #include "ui/aura/window_event_dispatcher.h" | 19 #include "ui/aura/window_event_dispatcher.h" |
| 20 | 20 |
| 21 namespace chromeos { | 21 namespace chromeos { |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 const char kTestAccount1[] = "user1@test.com"; | 24 const char kTestAccount1[] = "user1@test.com"; |
| 25 const char kTestAccount2[] = "user2@test.com"; | 25 const char kTestAccount2[] = "user2@test.com"; |
| 26 | 26 |
| 27 class WallpaperPrivateApiUnittest : public ash::test::AshTestBase { | 27 class WallpaperPrivateApiUnittest : public ash::test::AshTestBase { |
| 28 public: | 28 public: |
| 29 WallpaperPrivateApiUnittest() | 29 WallpaperPrivateApiUnittest() |
| 30 : fake_user_manager_(new FakeUserManager()), | 30 : fake_user_manager_(new FakeChromeUserManager()), |
| 31 scoped_user_manager_(fake_user_manager_) { | 31 scoped_user_manager_(fake_user_manager_) {} |
| 32 } | |
| 33 | 32 |
| 34 protected: | 33 protected: |
| 35 FakeUserManager* fake_user_manager() { | 34 FakeChromeUserManager* fake_user_manager() { return fake_user_manager_; } |
| 36 return fake_user_manager_; | |
| 37 } | |
| 38 | 35 |
| 39 private: | 36 private: |
| 40 FakeUserManager* fake_user_manager_; | 37 FakeChromeUserManager* fake_user_manager_; |
| 41 ScopedUserManagerEnabler scoped_user_manager_; | 38 ScopedUserManagerEnabler scoped_user_manager_; |
| 42 | 39 |
| 43 DISALLOW_COPY_AND_ASSIGN(WallpaperPrivateApiUnittest); | 40 DISALLOW_COPY_AND_ASSIGN(WallpaperPrivateApiUnittest); |
| 44 }; | 41 }; |
| 45 | 42 |
| 46 class TestMinimizeFunction | 43 class TestMinimizeFunction |
| 47 : public WallpaperPrivateMinimizeInactiveWindowsFunction { | 44 : public WallpaperPrivateMinimizeInactiveWindowsFunction { |
| 48 public: | 45 public: |
| 49 TestMinimizeFunction() {} | 46 TestMinimizeFunction() {} |
| 50 | 47 |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 scoped_refptr<TestRestoreFunction> restore_function_1( | 389 scoped_refptr<TestRestoreFunction> restore_function_1( |
| 393 new TestRestoreFunction()); | 390 new TestRestoreFunction()); |
| 394 EXPECT_TRUE(restore_function_1->RunAsync()); | 391 EXPECT_TRUE(restore_function_1->RunAsync()); |
| 395 | 392 |
| 396 EXPECT_FALSE(window1_state->IsMinimized()); | 393 EXPECT_FALSE(window1_state->IsMinimized()); |
| 397 EXPECT_FALSE(window2_state->IsMinimized()); | 394 EXPECT_FALSE(window2_state->IsMinimized()); |
| 398 EXPECT_FALSE(window3_state->IsMinimized()); | 395 EXPECT_FALSE(window3_state->IsMinimized()); |
| 399 } | 396 } |
| 400 | 397 |
| 401 } // namespace chromeos | 398 } // namespace chromeos |
| OLD | NEW |