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

Unified Diff: chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc

Issue 1023863003: Don't track windows that were interacted (restored/minimized) by user while wallpaper picker applic… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test. Created 5 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/extensions/wallpaper_private_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc
diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc
index fc2c66523851228d513607f4ccdd48f7cbf206ba..16843b7cf6e5528b8d84ef9efb9c21077b1d59bc 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc
@@ -70,6 +70,7 @@ class TestRestoreFunction
TEST_F(WallpaperPrivateApiUnittest, HideAndRestoreWindows) {
fake_user_manager()->AddUser(kTestAccount1);
+ scoped_ptr<aura::Window> window4(CreateTestWindowInShellWithId(4));
scoped_ptr<aura::Window> window3(CreateTestWindowInShellWithId(3));
scoped_ptr<aura::Window> window2(CreateTestWindowInShellWithId(2));
scoped_ptr<aura::Window> window1(CreateTestWindowInShellWithId(1));
@@ -79,6 +80,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndRestoreWindows) {
ash::wm::WindowState* window1_state = ash::wm::GetWindowState(window1.get());
ash::wm::WindowState* window2_state = ash::wm::GetWindowState(window2.get());
ash::wm::WindowState* window3_state = ash::wm::GetWindowState(window3.get());
+ ash::wm::WindowState* window4_state = ash::wm::GetWindowState(window4.get());
window3_state->Minimize();
window1_state->Maximize();
@@ -88,6 +90,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndRestoreWindows) {
EXPECT_FALSE(window1_state->IsMinimized());
EXPECT_FALSE(window2_state->IsMinimized());
EXPECT_TRUE(window3_state->IsMinimized());
+ EXPECT_FALSE(window4_state->IsMinimized());
// We then activate window 0 (i.e. wallpaper picker) and call the minimize
// function.
@@ -102,6 +105,11 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndRestoreWindows) {
EXPECT_TRUE(window1_state->IsMinimized());
EXPECT_TRUE(window2_state->IsMinimized());
EXPECT_TRUE(window3_state->IsMinimized());
+ EXPECT_TRUE(window4_state->IsMinimized());
+
+ // Activates window 4 and then minimizes it.
+ window4_state->Activate();
+ window4_state->Minimize();
// Then we destroy window 0 and call the restore function.
window0.reset();
@@ -110,10 +118,12 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndRestoreWindows) {
EXPECT_TRUE(restore_function->RunAsync());
// Windows 1 and 2 should no longer be minimized. Window 1 should again
- // be maximized. Window 3 should still be minimized.
+ // be maximized. Window 3 should still be minimized. Window 4 should remain
+ // minimized since user interacted with it while wallpaper picker was open.
EXPECT_TRUE(window1_state->IsMaximized());
EXPECT_FALSE(window2_state->IsMinimized());
EXPECT_TRUE(window3_state->IsMinimized());
+ EXPECT_TRUE(window4_state->IsMinimized());
}
// Test for multiple calls to |MinimizeInactiveWindows| before call
« no previous file with comments | « chrome/browser/chromeos/extensions/wallpaper_private_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698