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

Unified Diff: ash/extended_desktop_unittest.cc

Issue 1483083003: Set the window state consistently Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/wm/lock_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/extended_desktop_unittest.cc
diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc
index 64eee29a37cc262582a172252a9fdd734976d115..d8e5bf4d85252e1a4c9e7999df73148260cc979f 100644
--- a/ash/extended_desktop_unittest.cc
+++ b/ash/extended_desktop_unittest.cc
@@ -643,7 +643,7 @@ TEST_F(ExtendedDesktopTest, MoveWindowWithTransient) {
views::Widget* w1 = CreateTestWidget(gfx::Rect(10, 10, 100, 100));
views::Widget* w1_t1 = CreateTestWidgetWithParent(
w1, gfx::Rect(50, 50, 50, 50), false /* transient */);
- // Transient child of the transient child.
+ // Transient child of the child of the parent.
views::Widget* w1_t11 = CreateTestWidgetWithParent(
w1_t1, gfx::Rect(1200, 70, 35, 35), false /* transient */);
@@ -659,13 +659,12 @@ TEST_F(ExtendedDesktopTest, MoveWindowWithTransient) {
EXPECT_EQ(root_windows[0], w11_t1->GetNativeView()->GetRootWindow());
EXPECT_EQ("50,50 50x50",
w1_t1->GetWindowBoundsInScreen().ToString());
- EXPECT_EQ("1200,70 35x35",
- w1_t11->GetWindowBoundsInScreen().ToString());
+ // The window must fit inside the workarea.
+ EXPECT_EQ("975,70 35x35", w1_t11->GetWindowBoundsInScreen().ToString());
EXPECT_EQ("20,20 40x40",
w11->GetWindowBoundsInScreen().ToString());
- EXPECT_EQ("1300,100 80x80",
- w11_t1->GetWindowBoundsInScreen().ToString());
-
+ // The window must fit inside the workarea.
+ EXPECT_EQ("975,100 80x80", w11_t1->GetWindowBoundsInScreen().ToString());
w1->SetBounds(gfx::Rect(1100, 10, 100, 100));
EXPECT_EQ(root_windows[1], w1_t1->GetNativeView()->GetRootWindow());
@@ -679,10 +678,9 @@ TEST_F(ExtendedDesktopTest, MoveWindowWithTransient) {
// Transient window's screen bounds stays the same.
EXPECT_EQ("50,50 50x50",
w1_t1->GetWindowBoundsInScreen().ToString());
- EXPECT_EQ("1200,70 35x35",
- w1_t11->GetWindowBoundsInScreen().ToString());
- EXPECT_EQ("1300,100 80x80",
- w11_t1->GetWindowBoundsInScreen().ToString());
+ // TODO(oshima): window should probably be fit into the desktop in this case.
+ EXPECT_EQ("975,70 35x35", w1_t11->GetWindowBoundsInScreen().ToString());
+ EXPECT_EQ("975,100 80x80", w11_t1->GetWindowBoundsInScreen().ToString());
// Transient window doesn't move between root window unless
// its transient parent moves.
« no previous file with comments | « no previous file | ash/wm/lock_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698