| 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_shell_delegate.h" | 7 #include "ash/test/test_shell_delegate.h" |
| 8 #include "ash/wm/window_util.h" | 8 #include "ash/wm/window_util.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/chromeos/extensions/wallpaper_private_api.h" | 10 #include "chrome/browser/chromeos/extensions/wallpaper_private_api.h" |
| 11 #include "content/public/test/test_browser_thread.h" | |
| 12 #include "ui/aura/root_window.h" | 11 #include "ui/aura/root_window.h" |
| 13 #include "ui/aura/test/test_windows.h" | 12 #include "ui/aura/test/test_windows.h" |
| 14 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 class WallpaperPrivateApiUnittest : public ash::test::AshTestBase { | 17 class WallpaperPrivateApiUnittest : public ash::test::AshTestBase { |
| 19 public: | |
| 20 WallpaperPrivateApiUnittest() | |
| 21 : ui_thread_(content::BrowserThread::UI, message_loop()) {} | |
| 22 | |
| 23 private: | |
| 24 content::TestBrowserThread ui_thread_; | |
| 25 | |
| 26 DISALLOW_COPY_AND_ASSIGN(WallpaperPrivateApiUnittest); | |
| 27 }; | 18 }; |
| 28 | 19 |
| 29 class TestMinimizeFunction | 20 class TestMinimizeFunction |
| 30 : public WallpaperPrivateMinimizeInactiveWindowsFunction { | 21 : public WallpaperPrivateMinimizeInactiveWindowsFunction { |
| 31 public: | 22 public: |
| 32 TestMinimizeFunction() {} | 23 TestMinimizeFunction() {} |
| 33 | 24 |
| 34 virtual bool RunImpl() OVERRIDE { | 25 virtual bool RunImpl() OVERRIDE { |
| 35 return WallpaperPrivateMinimizeInactiveWindowsFunction::RunImpl(); | 26 return WallpaperPrivateMinimizeInactiveWindowsFunction::RunImpl(); |
| 36 } | 27 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 new TestRestoreFunction()); | 79 new TestRestoreFunction()); |
| 89 EXPECT_TRUE(restore_function->RunImpl()); | 80 EXPECT_TRUE(restore_function->RunImpl()); |
| 90 | 81 |
| 91 // Windows 1 and 2 should no longer be minimized. Window 1 should again | 82 // Windows 1 and 2 should no longer be minimized. Window 1 should again |
| 92 // be maximized. Window 3 should still be minimized. | 83 // be maximized. Window 3 should still be minimized. |
| 93 EXPECT_FALSE(ash::wm::IsWindowMinimized(window1.get())); | 84 EXPECT_FALSE(ash::wm::IsWindowMinimized(window1.get())); |
| 94 EXPECT_TRUE(ash::wm::IsWindowMaximized(window1.get())); | 85 EXPECT_TRUE(ash::wm::IsWindowMaximized(window1.get())); |
| 95 EXPECT_FALSE(ash::wm::IsWindowMinimized(window2.get())); | 86 EXPECT_FALSE(ash::wm::IsWindowMinimized(window2.get())); |
| 96 EXPECT_TRUE(ash::wm::IsWindowMinimized(window3.get())); | 87 EXPECT_TRUE(ash::wm::IsWindowMinimized(window3.get())); |
| 97 } | 88 } |
| OLD | NEW |