OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/string_number_conversions.h" | 6 #include "base/string_number_conversions.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/download/download_service.h" | 9 #include "chrome/browser/download/download_service.h" |
10 #include "chrome/browser/download/download_service_factory.h" | 10 #include "chrome/browser/download/download_service_factory.h" |
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1498 content::Source<Browser>(panel_browser)); | 1498 content::Source<Browser>(panel_browser)); |
1499 panel_browser->ConvertPopupToTabbedBrowser(); | 1499 panel_browser->ConvertPopupToTabbedBrowser(); |
1500 signal.Wait(); | 1500 signal.Wait(); |
1501 EXPECT_EQ(0, PanelManager::GetInstance()->num_panels()); | 1501 EXPECT_EQ(0, PanelManager::GetInstance()->num_panels()); |
1502 | 1502 |
1503 Browser* tabbed_browser = BrowserList::FindTabbedBrowser(profile, false); | 1503 Browser* tabbed_browser = BrowserList::FindTabbedBrowser(profile, false); |
1504 EXPECT_EQ(contents, tabbed_browser->GetSelectedTabContentsWrapper()); | 1504 EXPECT_EQ(contents, tabbed_browser->GetSelectedTabContentsWrapper()); |
1505 tabbed_browser->window()->Close(); | 1505 tabbed_browser->window()->Close(); |
1506 } | 1506 } |
1507 | 1507 |
1508 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, SizeClamping) { | |
1509 // Using small sizes avoids default size to be assigned. In this case | |
1510 // minimum sizes should take effect. | |
1511 CreatePanelParams params("Panel", gfx::Rect(0, 0, 1, 1), SHOW_AS_ACTIVE); | |
1512 Panel* panel = CreatePanelWithParams(params); | |
1513 // These should be in sync with kPanelMinWidth/Height in panel_manager.cc | |
1514 EXPECT_EQ(100, panel->GetBounds().width()); | |
jennb
2011/11/22 00:25:26
Should fetched these numbers from panel_manager. T
| |
1515 EXPECT_EQ(20, panel->GetBounds().height()); | |
1516 panel->Close(); | |
1517 | |
1518 // Using '0' sizes is equivalent of not providing sizes in API and causes | |
1519 // default sizes to be applied. | |
1520 CreatePanelParams params1("Panel1", gfx::Rect(0, 0, 0, 0), SHOW_AS_ACTIVE); | |
1521 panel = CreatePanelWithParams(params1); | |
1522 // These should be in sync with kPanelDefaultWidth/Height in panel_manager.cc | |
1523 EXPECT_EQ(240, panel->GetBounds().width()); | |
jennb
2011/11/22 00:25:26
Ditto.
| |
1524 EXPECT_EQ(290, panel->GetBounds().height()); | |
1525 panel->Close(); | |
1526 } | |
1527 | |
1508 class PanelDownloadTest : public PanelBrowserTest { | 1528 class PanelDownloadTest : public PanelBrowserTest { |
1509 public: | 1529 public: |
1510 PanelDownloadTest() : PanelBrowserTest() { } | 1530 PanelDownloadTest() : PanelBrowserTest() { } |
1511 | 1531 |
1512 // Creates a temporary directory for downloads that is auto-deleted | 1532 // Creates a temporary directory for downloads that is auto-deleted |
1513 // on destruction. | 1533 // on destruction. |
1514 bool CreateDownloadDirectory(Profile* profile) { | 1534 bool CreateDownloadDirectory(Profile* profile) { |
1515 bool created = downloads_directory_.CreateUniqueTempDir(); | 1535 bool created = downloads_directory_.CreateUniqueTempDir(); |
1516 if (!created) | 1536 if (!created) |
1517 return false; | 1537 return false; |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1832 // position when tall panel brings up its titlebar. | 1852 // position when tall panel brings up its titlebar. |
1833 CloseWindowAndWait(panel1->browser()); | 1853 CloseWindowAndWait(panel1->browser()); |
1834 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up, | 1854 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up, |
1835 GetBalloonBottomPosition(balloon)); | 1855 GetBalloonBottomPosition(balloon)); |
1836 | 1856 |
1837 // Closing the remaining tall panel should move the notification balloon back | 1857 // Closing the remaining tall panel should move the notification balloon back |
1838 // to its original position. | 1858 // to its original position. |
1839 CloseWindowAndWait(panel2->browser()); | 1859 CloseWindowAndWait(panel2->browser()); |
1840 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon)); | 1860 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon)); |
1841 } | 1861 } |
OLD | NEW |