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

Unified Diff: ash/root_window_controller_unittest.cc

Issue 149493008: Use active window if on current workspace for fullscreen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with master. Created 6 years, 10 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 | « ash/root_window_controller.cc ('k') | ash/switchable_windows.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller_unittest.cc
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index 9835cc5326d5d5f4178a4d93cc8776dfab00edc0..407f9b9795933b08ca19b3a52631ea42c5cce157 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -458,6 +458,44 @@ TEST_F(RootWindowControllerTest, GetWindowForFullscreenMode) {
EXPECT_EQ(NULL, controller->GetWindowForFullscreenMode());
}
+TEST_F(RootWindowControllerTest, MultipleDisplaysGetWindowForFullscreenMode) {
+ if (!SupportsMultipleDisplays())
+ return;
+
+ UpdateDisplay("600x600,600x600");
+ Shell::RootWindowControllerList controllers =
+ Shell::GetInstance()->GetAllRootWindowControllers();
+
+ Widget* w1 = CreateTestWidget(gfx::Rect(0, 0, 100, 100));
+ w1->Maximize();
+ Widget* w2 = CreateTestWidget(gfx::Rect(0, 0, 100, 100));
+ w2->SetFullscreen(true);
+ Widget* w3 = CreateTestWidget(gfx::Rect(600, 0, 100, 100));
+
+ EXPECT_EQ(w1->GetNativeWindow()->GetRootWindow(),
+ controllers[0]->root_window());
+ EXPECT_EQ(w2->GetNativeWindow()->GetRootWindow(),
+ controllers[0]->root_window());
+ EXPECT_EQ(w3->GetNativeWindow()->GetRootWindow(),
+ controllers[1]->root_window());
+
+ w1->Activate();
+ EXPECT_EQ(NULL, controllers[0]->GetWindowForFullscreenMode());
+ EXPECT_EQ(NULL, controllers[1]->GetWindowForFullscreenMode());
+
+ w2->Activate();
+ EXPECT_EQ(w2->GetNativeWindow(),
+ controllers[0]->GetWindowForFullscreenMode());
+ EXPECT_EQ(NULL, controllers[1]->GetWindowForFullscreenMode());
+
+ // Verify that the first root window controller remains in fullscreen mode
+ // when a window on the other display is activated.
+ w3->Activate();
+ EXPECT_EQ(w2->GetNativeWindow(),
+ controllers[0]->GetWindowForFullscreenMode());
+ EXPECT_EQ(NULL, controllers[1]->GetWindowForFullscreenMode());
+}
+
// Test that user session window can't be focused if user session blocked by
// some overlapping UI.
TEST_F(RootWindowControllerTest, FocusBlockedWindow) {
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/switchable_windows.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698