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

Unified Diff: trunk/src/ash/wm/drag_window_resizer_unittest.cc

Issue 108343005: Revert 240542 "Make sure the dragged window is smaller than work..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 | « trunk/src/ash/wm/drag_window_resizer.cc ('k') | trunk/src/ash/wm/workspace/workspace_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ash/wm/drag_window_resizer_unittest.cc
===================================================================
--- trunk/src/ash/wm/drag_window_resizer_unittest.cc (revision 240586)
+++ trunk/src/ash/wm/drag_window_resizer_unittest.cc (working copy)
@@ -162,7 +162,7 @@
// The secondary display is logically on the right, but on the system (e.g. X)
// layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc.
- UpdateDisplay("800x600,400x300");
+ UpdateDisplay("800x600,800x600");
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
ASSERT_EQ(2U, root_windows.size());
@@ -223,55 +223,6 @@
EXPECT_EQ(base::IntToString(expected_x) + ",10 50x60",
window_->bounds().ToString());
}
- // Dropping a window that is larger than the destination work area
- // will shrink to fit to the work area.
- window_->SetBoundsInScreen(gfx::Rect(0, 0, 700, 500),
- Shell::GetScreen()->GetPrimaryDisplay());
- EXPECT_EQ(root_windows[0], window_->GetRootWindow());
- {
- // Grab the top-right edge of the window and move the pointer to (0, 10)
- // in the secondary root window's coordinates.
- scoped_ptr<WindowResizer> resizer(CreateDragWindowResizer(
- window_.get(), gfx::Point(699, 0), HTCAPTION));
- ASSERT_TRUE(resizer.get());
- resizer->Drag(CalculateDragPoint(*resizer, 101, 10), ui::EF_CONTROL_DOWN);
- resizer->CompleteDrag(0);
- EXPECT_EQ(root_windows[1], window_->GetRootWindow());
- // Window size should be adjusted to fit to the work area
- EXPECT_EQ("400x253", window_->bounds().size().ToString());
- gfx::Rect window_bounds_in_screen = window_->GetBoundsInScreen();
- gfx::Rect intersect(window_->GetRootWindow()->GetBoundsInScreen());
- intersect.Intersect(window_bounds_in_screen);
- EXPECT_LE(10, intersect.width());
- EXPECT_LE(10, intersect.height());
- EXPECT_TRUE(window_bounds_in_screen.Contains(gfx::Point(800, 10)));
- }
-
- // Dropping a window that is larger than the destination work area
- // will shrink to fit to the work area.
- window_->SetBoundsInScreen(gfx::Rect(0, 0, 700, 500),
- Shell::GetScreen()->GetPrimaryDisplay());
- EXPECT_EQ(root_windows[0], window_->GetRootWindow());
- {
- // Grab the top-left edge of the window and move the pointer to (150, 10)
- // in the secondary root window's coordinates. Make sure the window is
- // shrink in such a way that it keeps the cursor within.
- scoped_ptr<WindowResizer> resizer(CreateDragWindowResizer(
- window_.get(), gfx::Point(0, 0), HTCAPTION));
- ASSERT_TRUE(resizer.get());
- resizer->Drag(CalculateDragPoint(*resizer, 799, 10), ui::EF_CONTROL_DOWN);
- resizer->Drag(CalculateDragPoint(*resizer, 850, 10), ui::EF_CONTROL_DOWN);
- resizer->CompleteDrag(0);
- EXPECT_EQ(root_windows[1], window_->GetRootWindow());
- // Window size should be adjusted to fit to the work area
- EXPECT_EQ("400x253", window_->bounds().size().ToString());
- gfx::Rect window_bounds_in_screen = window_->GetBoundsInScreen();
- gfx::Rect intersect(window_->GetRootWindow()->GetBoundsInScreen());
- intersect.Intersect(window_bounds_in_screen);
- EXPECT_LE(10, intersect.width());
- EXPECT_LE(10, intersect.height());
- EXPECT_TRUE(window_bounds_in_screen.Contains(gfx::Point(850, 10)));
- }
}
// Verifies that dragging the active window to another display makes the new
« no previous file with comments | « trunk/src/ash/wm/drag_window_resizer.cc ('k') | trunk/src/ash/wm/workspace/workspace_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698