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

Unified Diff: chrome/browser/ui/panels/panel_resize_browsertest.cc

Issue 10260001: Remove panel size limit when user resizes it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 8 years, 8 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
Index: chrome/browser/ui/panels/panel_resize_browsertest.cc
diff --git a/chrome/browser/ui/panels/panel_resize_browsertest.cc b/chrome/browser/ui/panels/panel_resize_browsertest.cc
index fcc8d1d642616f6193793f381f74fb49ec5a496b..08c7ffe37f60743a13920b2e423eb35220c79ad9 100644
--- a/chrome/browser/ui/panels/panel_resize_browsertest.cc
+++ b/chrome/browser/ui/panels/panel_resize_browsertest.cc
@@ -235,15 +235,21 @@ IN_PROC_BROWSER_TEST_F(PanelResizeBrowserTest, ResizeDetachedPanelToClampSize) {
panel_manager->EndResizingByMouse(false);
EXPECT_EQ(bounds, panel->GetBounds());
- // Make sure the panel does not resize larger than its size.
+ // Make sure the panel can resize larger than its size. User is in control.
mouse_location = bounds.origin().Add(
gfx::Point(bounds.width(), bounds.height() - 2));
panel_manager->StartResizingByMouse(panel, mouse_location,
panel::RESIZE_BOTTOM_RIGHT);
- mouse_location.Offset(500, 40);
+
+ // This drag would take us beyond max size.
+ int delta_x = panel->max_size().width() + 10 - panel->GetBounds().width();
+ int delta_y = panel->max_size().height() + 10 - panel->GetBounds().height();
+ mouse_location.Offset(delta_x, delta_y);
panel_manager->ResizeByMouse(mouse_location);
- bounds.set_size(gfx::Size(panel->max_size().width(), bounds.height() + 40));
+ // The bounds if the max_size does not limit the resize.
+ bounds.set_size(gfx::Size(bounds.width() + delta_x,
+ bounds.height() + delta_y));
EXPECT_EQ(bounds, panel->GetBounds());
panel_manager->EndResizingByMouse(false);
« no previous file with comments | « chrome/browser/ui/panels/panel_browser_view_browsertest.cc ('k') | chrome/browser/ui/panels/panel_resize_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698