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

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
Index: ash/root_window_controller_unittest.cc
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index d547a8a335099074ab4f11962e4f4da675a6a6d3..8564fff07fe8ca4a060c32d47f5b8de089f809d4 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -155,8 +155,8 @@ class RootWindowControllerTest : public test::AshTestBase {
TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
varkha 2013/12/12 16:20:46 nit: I think you could quote this test in the CL T
oshima 2013/12/12 19:07:14 Done.
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();
@@ -174,8 +174,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));
@@ -184,13 +184,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;
@@ -225,8 +225,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
@@ -251,7 +251,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());
@@ -263,14 +263,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.

Powered by Google App Engine
This is Rietveld 408576698