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

Unified Diff: ash/wm/workspace/workspace_window_resizer_unittest.cc

Issue 11369017: Use correct restore bounds in resizer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/wm/workspace/workspace_window_resizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_window_resizer_unittest.cc
diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc
index 969ad1f4bcb4c8bf632afd49d244e23630f30144..793f3bb89b34953195a62143c39eac8623556758 100644
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc
@@ -474,15 +474,45 @@ TEST_F(WorkspaceWindowResizerTest, Edge) {
GetRestoreBoundsInScreen(window_.get())->ToString());
}
// Try the same with the right side.
- scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create(
- window_.get(), gfx::Point(), HTCAPTION, empty_windows()));
- ASSERT_TRUE(resizer.get());
- resizer->Drag(CalculateDragPoint(*resizer, 800, 10), 0);
- resizer->CompleteDrag(0);
- EXPECT_EQ("80,0 720x" + base::IntToString(bottom),
- window_->bounds().ToString());
- ASSERT_TRUE(GetRestoreBoundsInScreen(window_.get()));
- EXPECT_EQ("20,30 50x60", GetRestoreBoundsInScreen(window_.get())->ToString());
+ {
+ scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create(
+ window_.get(), gfx::Point(), HTCAPTION, empty_windows()));
+ ASSERT_TRUE(resizer.get());
+ resizer->Drag(CalculateDragPoint(*resizer, 800, 10), 0);
+ resizer->CompleteDrag(0);
+ EXPECT_EQ("80,0 720x" + base::IntToString(bottom),
+ window_->bounds().ToString());
+ ASSERT_TRUE(GetRestoreBoundsInScreen(window_.get()));
+ EXPECT_EQ("20,30 50x60",
+ GetRestoreBoundsInScreen(window_.get())->ToString());
+ }
+
+#if !defined(OS_WIN)
+ // Test if the restore bounds is correct in multiple displays.
+ ClearRestoreBounds(window_.get());
+ UpdateDisplay("800x600,200x600");
+ Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ EXPECT_EQ(root_windows[0], window_->GetRootWindow());
+ window_->SetBoundsInScreen(gfx::Rect(800, 10, 50, 60),
+ ScreenAsh::GetSecondaryDisplay());
+ EXPECT_EQ(root_windows[1], window_->GetRootWindow());
+ {
+ bottom =
+ ScreenAsh::GetDisplayWorkAreaBoundsInParent(window_.get()).bottom();
+ EXPECT_EQ("800,10 50x60", window_->GetBoundsInScreen().ToString());
+
+ scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create(
+ window_.get(), gfx::Point(), HTCAPTION, empty_windows()));
+ ASSERT_TRUE(resizer.get());
+
+ resizer->Drag(CalculateDragPoint(*resizer, 199, 00), 0);
+ resizer->CompleteDrag(0);
+ EXPECT_EQ("20,0 180x" + base::IntToString(bottom),
+ window_->bounds().ToString());
+ EXPECT_EQ("800,10 50x60",
+ GetRestoreBoundsInScreen(window_.get())->ToString());
+ }
+#endif
}
// Verifies a window can be moved from the primary display to another.
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698