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

Unified Diff: ash/root_window_controller_unittest.cc

Issue 93873013: Make sure the dragged window is smaller than work area in the target display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « ash/root_window_controller.cc ('k') | ash/wm/drag_window_resizer.cc » ('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 237a513a451ffbfa0d96fd141bfade232ed2234c..d80f62d6f72fcf4fd9f8f56037886d633b8316db 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -127,8 +127,8 @@ class RootWindowControllerTest : public test::AshTestBase {
TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
if (!SupportsMultipleDisplays())
return;
-
- UpdateDisplay("600x600,500x500");
+ // Windows origin should be doubled when moved to the 1st display.
+ UpdateDisplay("600x600,300x300");
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
internal::RootWindowController* controller =
Shell::GetPrimaryRootWindowController();
@@ -146,8 +146,8 @@ TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
views::Widget* maximized = CreateTestWidget(gfx::Rect(700, 10, 100, 100));
maximized->Maximize();
EXPECT_EQ(root_windows[1], maximized->GetNativeView()->GetRootWindow());
- EXPECT_EQ("600,0 500x453", maximized->GetWindowBoundsInScreen().ToString());
- EXPECT_EQ("0,0 500x453",
+ EXPECT_EQ("600,0 300x253", maximized->GetWindowBoundsInScreen().ToString());
+ EXPECT_EQ("0,0 300x253",
maximized->GetNativeView()->GetBoundsInRootWindow().ToString());
views::Widget* minimized = CreateTestWidget(gfx::Rect(800, 10, 100, 100));
@@ -156,13 +156,13 @@ TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
EXPECT_EQ("800,10 100x100",
minimized->GetWindowBoundsInScreen().ToString());
- views::Widget* fullscreen = CreateTestWidget(gfx::Rect(900, 10, 100, 100));
+ views::Widget* fullscreen = CreateTestWidget(gfx::Rect(850, 10, 100, 100));
fullscreen->SetFullscreen(true);
EXPECT_EQ(root_windows[1], fullscreen->GetNativeView()->GetRootWindow());
- EXPECT_EQ("600,0 500x500",
+ EXPECT_EQ("600,0 300x300",
fullscreen->GetWindowBoundsInScreen().ToString());
- EXPECT_EQ("0,0 500x500",
+ EXPECT_EQ("0,0 300x300",
fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString());
views::Widget* unparented_control = new Widget;
@@ -197,8 +197,8 @@ TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
EXPECT_FALSE(tracker.Contains(d2));
EXPECT_EQ(root_windows[0], normal->GetNativeView()->GetRootWindow());
- EXPECT_EQ("50,10 100x100", normal->GetWindowBoundsInScreen().ToString());
- EXPECT_EQ("50,10 100x100",
+ EXPECT_EQ("100,20 100x100", normal->GetWindowBoundsInScreen().ToString());
+ EXPECT_EQ("100,20 100x100",
normal->GetNativeView()->GetBoundsInRootWindow().ToString());
// Maximized area on primary display has 3px (given as
@@ -223,7 +223,7 @@ TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
maximized->GetNativeView()->GetBoundsInRootWindow().ToString());
EXPECT_EQ(root_windows[0], minimized->GetNativeView()->GetRootWindow());
- EXPECT_EQ("200,10 100x100",
+ EXPECT_EQ("400,20 100x100",
minimized->GetWindowBoundsInScreen().ToString());
EXPECT_EQ(root_windows[0], fullscreen->GetNativeView()->GetRootWindow());
@@ -235,14 +235,14 @@ TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
// Test if the restore bounds are correctly updated.
wm::GetWindowState(maximized->GetNativeView())->Restore();
- EXPECT_EQ("100,10 100x100", maximized->GetWindowBoundsInScreen().ToString());
- EXPECT_EQ("100,10 100x100",
+ EXPECT_EQ("200,20 100x100", maximized->GetWindowBoundsInScreen().ToString());
+ EXPECT_EQ("200,20 100x100",
maximized->GetNativeView()->GetBoundsInRootWindow().ToString());
fullscreen->SetFullscreen(false);
- EXPECT_EQ("300,10 100x100",
+ EXPECT_EQ("500,20 100x100",
fullscreen->GetWindowBoundsInScreen().ToString());
- EXPECT_EQ("300,10 100x100",
+ EXPECT_EQ("500,20 100x100",
fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString());
// Test if the unparented widget has moved.
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/wm/drag_window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698