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

Unified Diff: ash/root_window_controller_unittest.cc

Issue 2703333003: Clamp the restore bounds to new workspace when a display is disconnected. (Closed)
Patch Set: removed unnnecessary checks Created 3 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') | no next file » | 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 4d33dee044f5f92312abd25a25a08660aabc9b4a..56b0655571d1332d81b81fff9843a06a958b80d1 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -153,12 +153,18 @@ TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
EXPECT_EQ(gfx::Rect(0, 0, 300, 252).ToString(),
maximized->GetNativeView()->GetBoundsInRootWindow().ToString());
- views::Widget* minimized = CreateTestWidget(gfx::Rect(800, 10, 100, 100));
+ views::Widget* minimized = CreateTestWidget(gfx::Rect(550, 10, 200, 200));
minimized->Minimize();
EXPECT_EQ(root_windows[1], minimized->GetNativeView()->GetRootWindow());
- EXPECT_EQ("800,10 100x100", minimized->GetWindowBoundsInScreen().ToString());
+ EXPECT_EQ("550,10 200x200", minimized->GetWindowBoundsInScreen().ToString());
+
+ views::Widget* fullscreen = CreateTestWidget(gfx::Rect(850, 10, 200, 200));
+ display::Display secondary_display =
+ Shell::GetInstance()->display_manager()->GetSecondaryDisplay();
+ gfx::Rect orig_bounds = fullscreen->GetWindowBoundsInScreen();
+ EXPECT_TRUE(secondary_display.work_area().Intersects(orig_bounds));
+ EXPECT_FALSE(secondary_display.work_area().Contains(orig_bounds));
- views::Widget* fullscreen = CreateTestWidget(gfx::Rect(850, 10, 100, 100));
fullscreen->SetFullscreen(true);
EXPECT_EQ(root_windows[1], fullscreen->GetNativeView()->GetRootWindow());
@@ -224,7 +230,7 @@ TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
maximized->GetNativeView()->GetBoundsInRootWindow().ToString());
EXPECT_EQ(root_windows[0], minimized->GetNativeView()->GetRootWindow());
- EXPECT_EQ("400,20 100x100", minimized->GetWindowBoundsInScreen().ToString());
+ EXPECT_EQ("0,20 200x200", minimized->GetWindowBoundsInScreen().ToString());
EXPECT_EQ(root_windows[0], fullscreen->GetNativeView()->GetRootWindow());
EXPECT_TRUE(fullscreen->IsFullscreen());
@@ -239,8 +245,8 @@ TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
maximized->GetNativeView()->GetBoundsInRootWindow().ToString());
fullscreen->SetFullscreen(false);
- EXPECT_EQ("500,20 100x100", fullscreen->GetWindowBoundsInScreen().ToString());
- EXPECT_EQ("500,20 100x100",
+ EXPECT_EQ("400,20 200x200", fullscreen->GetWindowBoundsInScreen().ToString());
+ EXPECT_EQ("400,20 200x200",
fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString());
// Test if the unparented widget has moved.
« no previous file with comments | « ash/root_window_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698