Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc

Issue 11421006: Desktop aura: Break aura::Window::SetParent in two. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ash_unittests Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 bool RunImpl() OVERRIDE { 45 bool RunImpl() OVERRIDE {
46 return WallpaperRestoreMinimizedWindowsFunction::RunImpl(); 46 return WallpaperRestoreMinimizedWindowsFunction::RunImpl();
47 } 47 }
48 protected: 48 protected:
49 virtual ~TestRestoreFunction() {} 49 virtual ~TestRestoreFunction() {}
50 }; 50 };
51 51
52 } // namespace 52 } // namespace
53 53
54 TEST_F(WallpaperPrivateApiUnittest, HideAndRestoreWindows) { 54 TEST_F(WallpaperPrivateApiUnittest, HideAndRestoreWindows) {
55 scoped_ptr<aura::Window> window3(aura::test::CreateTestWindowWithId(3, NULL)); 55 scoped_ptr<aura::Window> window3(CreateTestWindowInShellWithId(3));
56 scoped_ptr<aura::Window> window2(aura::test::CreateTestWindowWithId(2, NULL)); 56 scoped_ptr<aura::Window> window2(CreateTestWindowInShellWithId(2));
57 scoped_ptr<aura::Window> window1(aura::test::CreateTestWindowWithId(1, NULL)); 57 scoped_ptr<aura::Window> window1(CreateTestWindowInShellWithId(1));
58 scoped_ptr<aura::Window> window0(aura::test::CreateTestWindowWithId(0, NULL)); 58 scoped_ptr<aura::Window> window0(CreateTestWindowInShellWithId(0));
59 59
60 ash::wm::MinimizeWindow(window3.get()); 60 ash::wm::MinimizeWindow(window3.get());
61 ash::wm::MaximizeWindow(window1.get()); 61 ash::wm::MaximizeWindow(window1.get());
62 62
63 // Window 3 starts minimized, window 1 starts maximized. 63 // Window 3 starts minimized, window 1 starts maximized.
64 EXPECT_FALSE(ash::wm::IsWindowMinimized(window0.get())); 64 EXPECT_FALSE(ash::wm::IsWindowMinimized(window0.get()));
65 EXPECT_FALSE(ash::wm::IsWindowMinimized(window1.get())); 65 EXPECT_FALSE(ash::wm::IsWindowMinimized(window1.get()));
66 EXPECT_FALSE(ash::wm::IsWindowMinimized(window2.get())); 66 EXPECT_FALSE(ash::wm::IsWindowMinimized(window2.get()));
67 EXPECT_TRUE(ash::wm::IsWindowMinimized(window3.get())); 67 EXPECT_TRUE(ash::wm::IsWindowMinimized(window3.get()));
68 68
(...skipping 17 matching lines...) Expand all
86 new TestRestoreFunction()); 86 new TestRestoreFunction());
87 EXPECT_TRUE(restore_function->RunImpl()); 87 EXPECT_TRUE(restore_function->RunImpl());
88 88
89 // Windows 1 and 2 should no longer be minimized. Window 1 should again 89 // Windows 1 and 2 should no longer be minimized. Window 1 should again
90 // be maximized. Window 3 should still be minimized. 90 // be maximized. Window 3 should still be minimized.
91 EXPECT_FALSE(ash::wm::IsWindowMinimized(window1.get())); 91 EXPECT_FALSE(ash::wm::IsWindowMinimized(window1.get()));
92 EXPECT_TRUE(ash::wm::IsWindowMaximized(window1.get())); 92 EXPECT_TRUE(ash::wm::IsWindowMaximized(window1.get()));
93 EXPECT_FALSE(ash::wm::IsWindowMinimized(window2.get())); 93 EXPECT_FALSE(ash::wm::IsWindowMinimized(window2.get()));
94 EXPECT_TRUE(ash::wm::IsWindowMinimized(window3.get())); 94 EXPECT_TRUE(ash::wm::IsWindowMinimized(window3.get()));
95 } 95 }
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer_unittest.cc ('k') | chrome/browser/ui/ash/window_positioner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698