Chromium Code Reviews| 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() { } |