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

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

Issue 8621002: Reduce minimum size of Panels to allow 1-text-line tight autosize. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simplify test Created 9 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 | « no previous file | chrome/browser/ui/panels/panel_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_browsertest.cc
diff --git a/chrome/browser/ui/panels/panel_browsertest.cc b/chrome/browser/ui/panels/panel_browsertest.cc
index 5f2db43a9e57648d4d3176b58b6199a869a23a14..0cb242115921b80404f631a45ff0ef7809b90bf8 100644
--- a/chrome/browser/ui/panels/panel_browsertest.cc
+++ b/chrome/browser/ui/panels/panel_browsertest.cc
@@ -1505,6 +1505,26 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, CreateWithExistingContents) {
tabbed_browser->window()->Close();
}
+IN_PROC_BROWSER_TEST_F(PanelBrowserTest, SizeClamping) {
+ // Using small sizes avoids default size to be assigned. In this case
+ // minimum sizes should take effect.
+ CreatePanelParams params("Panel", gfx::Rect(0, 0, 1, 1), SHOW_AS_ACTIVE);
+ Panel* panel = CreatePanelWithParams(params);
+ // These should be in sync with kPanelMinWidth/Height in panel_manager.cc
+ EXPECT_EQ(100, panel->GetBounds().width());
jennb 2011/11/22 00:25:26 Should fetched these numbers from panel_manager. T
+ EXPECT_EQ(20, panel->GetBounds().height());
+ panel->Close();
+
+ // Using '0' sizes is equivalent of not providing sizes in API and causes
+ // default sizes to be applied.
+ CreatePanelParams params1("Panel1", gfx::Rect(0, 0, 0, 0), SHOW_AS_ACTIVE);
+ panel = CreatePanelWithParams(params1);
+ // These should be in sync with kPanelDefaultWidth/Height in panel_manager.cc
+ EXPECT_EQ(240, panel->GetBounds().width());
jennb 2011/11/22 00:25:26 Ditto.
+ EXPECT_EQ(290, panel->GetBounds().height());
+ panel->Close();
+}
+
class PanelDownloadTest : public PanelBrowserTest {
public:
PanelDownloadTest() : PanelBrowserTest() { }
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698