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

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: fix tests 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..aa440e513b635bc3810560045557eb1388bfba4a 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_width(bounds.width() + delta_x);
jennb 2012/04/28 00:09:49 stick with bounds.set_size() for consistency in fi
Dmitry Titov 2012/04/28 00:57:40 Done.
+ bounds.set_height(bounds.height() + delta_y);
EXPECT_EQ(bounds, panel->GetBounds());
panel_manager->EndResizingByMouse(false);

Powered by Google App Engine
This is Rietveld 408576698