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

Unified Diff: ash/extended_desktop_unittest.cc

Issue 10836065: Improve WorkspaceWindowResizer::CompleteDrag() so that the function moves the window to a root windo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final rebase Created 8 years, 4 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/display/screen_position_controller.cc ('k') | ash/test/ash_test_base.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 fdfd7892d1ac08816f2b2f93b1919a4c15e95c65..ad68531d9c93f3e8f39c168cf3a4dba8deabf5ee 100644
--- a/ash/extended_desktop_unittest.cc
+++ b/ash/extended_desktop_unittest.cc
@@ -401,6 +401,35 @@ TEST_F(ExtendedDesktopTest, MoveWindow) {
EXPECT_EQ(root_windows[0], d1->GetNativeView()->GetRootWindow());
}
+TEST_F(ExtendedDesktopTest, MoveWindowToDisplay) {
+ UpdateDisplay("1000x1000,1000x1000");
+ Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+
+ gfx::Display display0 =
+ gfx::Screen::GetDisplayMatching(root_windows[0]->GetBoundsInScreen());
+ gfx::Display display1 =
+ gfx::Screen::GetDisplayMatching(root_windows[1]->GetBoundsInScreen());
+ EXPECT_NE(display0.id(), display1.id());
+
+ views::Widget* d1 = CreateTestWidget(gfx::Rect(10, 10, 1000, 100));
+ EXPECT_EQ(root_windows[0], d1->GetNativeView()->GetRootWindow());
+
+ // Move the window where the window spans both root windows. Since the second
+ // parameter is |display1|, the window should be shown on the secondary root.
+ d1->GetNativeWindow()->SetBoundsInScreen(gfx::Rect(500, 10, 1000, 100),
+ display1);
+ EXPECT_EQ("500,10 1000x100",
+ d1->GetWindowBoundsInScreen().ToString());
+ EXPECT_EQ(root_windows[1], d1->GetNativeView()->GetRootWindow());
+
+ // Move to the primary root.
+ d1->GetNativeWindow()->SetBoundsInScreen(gfx::Rect(500, 10, 1000, 100),
+ display0);
+ EXPECT_EQ("500,10 1000x100",
+ d1->GetWindowBoundsInScreen().ToString());
+ EXPECT_EQ(root_windows[0], d1->GetNativeView()->GetRootWindow());
+}
+
TEST_F(ExtendedDesktopTest, MoveWindowWithTransient) {
UpdateDisplay("1000x600,600x400");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
« no previous file with comments | « ash/display/screen_position_controller.cc ('k') | ash/test/ash_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698