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 10 matching lines...) Expand all Loading... | |
21 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" | 21 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" |
22 #include "chrome/browser/ui/browser_list.h" | 22 #include "chrome/browser/ui/browser_list.h" |
23 #include "chrome/browser/ui/browser_window.h" | 23 #include "chrome/browser/ui/browser_window.h" |
24 #include "chrome/browser/ui/find_bar/find_bar.h" | 24 #include "chrome/browser/ui/find_bar/find_bar.h" |
25 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 25 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
26 #include "chrome/browser/ui/panels/base_panel_browser_test.h" | 26 #include "chrome/browser/ui/panels/base_panel_browser_test.h" |
27 #include "chrome/browser/ui/panels/native_panel.h" | 27 #include "chrome/browser/ui/panels/native_panel.h" |
28 #include "chrome/browser/ui/panels/panel.h" | 28 #include "chrome/browser/ui/panels/panel.h" |
29 #include "chrome/browser/ui/panels/panel_manager.h" | 29 #include "chrome/browser/ui/panels/panel_manager.h" |
30 #include "chrome/browser/ui/panels/panel_settings_menu_model.h" | 30 #include "chrome/browser/ui/panels/panel_settings_menu_model.h" |
31 #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h" | |
31 #include "chrome/browser/web_applications/web_app.h" | 32 #include "chrome/browser/web_applications/web_app.h" |
32 #include "chrome/common/chrome_notification_types.h" | 33 #include "chrome/common/chrome_notification_types.h" |
33 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
34 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
35 #include "chrome/test/base/ui_test_utils.h" | 36 #include "chrome/test/base/ui_test_utils.h" |
36 #include "content/browser/download/download_manager.h" | 37 #include "content/browser/download/download_manager.h" |
37 #include "content/browser/net/url_request_mock_http_job.h" | 38 #include "content/browser/net/url_request_mock_http_job.h" |
38 #include "content/browser/tab_contents/tab_contents.h" | 39 #include "content/browser/tab_contents/tab_contents.h" |
39 #include "content/public/browser/notification_service.h" | 40 #include "content/public/browser/notification_service.h" |
40 #include "content/public/common/show_desktop_notification_params.h" | 41 #include "content/public/common/show_desktop_notification_params.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
57 size_t browser_count = BrowserList::size(); | 58 size_t browser_count = BrowserList::size(); |
58 ui_test_utils::WindowedNotificationObserver signal( | 59 ui_test_utils::WindowedNotificationObserver signal( |
59 chrome::NOTIFICATION_BROWSER_CLOSED, | 60 chrome::NOTIFICATION_BROWSER_CLOSED, |
60 content::Source<Browser>(browser)); | 61 content::Source<Browser>(browser)); |
61 browser->CloseWindow(); | 62 browser->CloseWindow(); |
62 signal.Wait(); | 63 signal.Wait(); |
63 // Now we have one less browser instance. | 64 // Now we have one less browser instance. |
64 EXPECT_EQ(browser_count - 1, BrowserList::size()); | 65 EXPECT_EQ(browser_count - 1, BrowserList::size()); |
65 } | 66 } |
66 | 67 |
67 void MoveMouse(gfx::Point position) { | 68 void MoveMouse(gfx::Point position) { |
jianli
2011/11/30 19:27:01
const gfx::Point&
jennb
2011/11/30 19:55:12
Done.
| |
68 PanelManager::GetInstance()->OnMouseMove(position); | 69 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); |
69 MessageLoopForUI::current()->RunAllPending(); | 70 MessageLoopForUI::current()->RunAllPending(); |
70 } | 71 } |
71 | 72 |
72 void MoveMouseAndWaitForExpansionStateChange(Panel* panel, | 73 void MoveMouseAndWaitForExpansionStateChange(Panel* panel, |
73 const gfx::Point& position) { | 74 const gfx::Point& position) { |
74 ui_test_utils::WindowedNotificationObserver signal( | 75 ui_test_utils::WindowedNotificationObserver signal( |
75 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, | 76 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, |
76 content::Source<Panel>(panel)); | 77 content::Source<Panel>(panel)); |
77 MoveMouse(position); | 78 MoveMouse(position); |
78 signal.Wait(); | 79 signal.Wait(); |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
506 EXPECT_GT(bounds.height(), 0); | 507 EXPECT_GT(bounds.height(), 0); |
507 | 508 |
508 EXPECT_EQ(bounds.right(), panel_manager->StartingRightPosition()); | 509 EXPECT_EQ(bounds.right(), panel_manager->StartingRightPosition()); |
509 | 510 |
510 CloseWindowAndWait(panel->browser()); | 511 CloseWindowAndWait(panel->browser()); |
511 | 512 |
512 EXPECT_EQ(0, panel_manager->num_panels()); | 513 EXPECT_EQ(0, panel_manager->num_panels()); |
513 } | 514 } |
514 | 515 |
515 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, CreateBigPanel) { | 516 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, CreateBigPanel) { |
516 PanelManager* panel_manager = PanelManager::GetInstance(); | |
517 Panel* panel = CreatePanelWithBounds("BigPanel", testing_work_area()); | 517 Panel* panel = CreatePanelWithBounds("BigPanel", testing_work_area()); |
518 gfx::Rect bounds = panel->GetBounds(); | 518 gfx::Rect bounds = panel->GetBounds(); |
519 EXPECT_EQ(panel_manager->GetMaxPanelWidth(), bounds.width()); | 519 EXPECT_EQ(panel->max_size().width(), bounds.width()); |
jianli
2011/11/30 19:27:01
Why not:
EXPECT_EQ(panel->min_size(), panel->Get
jennb
2011/11/30 19:55:12
It didn't work. I tried that first.
| |
520 EXPECT_LT(bounds.width(), testing_work_area().width()); | 520 EXPECT_LT(bounds.width(), testing_work_area().width()); |
521 EXPECT_EQ(panel_manager->GetMaxPanelHeight(), bounds.height()); | 521 EXPECT_EQ(panel->max_size().height(), bounds.height()); |
522 EXPECT_LT(bounds.height(), testing_work_area().height()); | 522 EXPECT_LT(bounds.height(), testing_work_area().height()); |
523 panel->Close(); | 523 panel->Close(); |
524 } | 524 } |
525 | 525 |
526 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, FindBar) { | 526 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, FindBar) { |
527 Panel* panel = CreatePanelWithBounds("PanelTest", gfx::Rect(0, 0, 400, 400)); | 527 Panel* panel = CreatePanelWithBounds("PanelTest", gfx::Rect(0, 0, 400, 400)); |
528 Browser* browser = panel->browser(); | 528 Browser* browser = panel->browser(); |
529 // FindBar needs tab contents. | 529 // FindBar needs tab contents. |
530 CreateTestTabContents(browser); | 530 CreateTestTabContents(browser); |
531 browser->ShowFindBar(); | 531 browser->ShowFindBar(); |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
878 EXPECT_LT(bounds_on_shrink.width(), bounds_on_grow.width()); | 878 EXPECT_LT(bounds_on_shrink.width(), bounds_on_grow.width()); |
879 EXPECT_GT(bounds_on_shrink.width(), initial_bounds.width()); | 879 EXPECT_GT(bounds_on_shrink.width(), initial_bounds.width()); |
880 EXPECT_EQ(bounds_on_shrink.height(), initial_bounds.height()); | 880 EXPECT_EQ(bounds_on_shrink.height(), initial_bounds.height()); |
881 | 881 |
882 panel->Close(); | 882 panel->Close(); |
883 } | 883 } |
884 | 884 |
885 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, RestoredBounds) { | 885 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, RestoredBounds) { |
886 // Disable mouse watcher. We don't care about mouse movements in this test. | 886 // Disable mouse watcher. We don't care about mouse movements in this test. |
887 PanelManager* panel_manager = PanelManager::GetInstance(); | 887 PanelManager* panel_manager = PanelManager::GetInstance(); |
888 panel_manager->disable_mouse_watching(); | 888 PanelMouseWatcher* mouse_watcher = new TestPanelMouseWatcher(); |
889 panel_manager->set_mouse_watcher(mouse_watcher); | |
889 Panel* panel = CreatePanelWithBounds("PanelTest", gfx::Rect(0, 0, 100, 100)); | 890 Panel* panel = CreatePanelWithBounds("PanelTest", gfx::Rect(0, 0, 100, 100)); |
890 EXPECT_EQ(Panel::EXPANDED, panel->expansion_state()); | 891 EXPECT_EQ(Panel::EXPANDED, panel->expansion_state()); |
891 EXPECT_EQ(panel->GetBounds(), panel->GetRestoredBounds()); | 892 EXPECT_EQ(panel->GetBounds(), panel->GetRestoredBounds()); |
892 EXPECT_EQ(0, panel_manager->minimized_panel_count()); | 893 EXPECT_EQ(0, panel_manager->minimized_panel_count()); |
893 | 894 |
894 panel->SetExpansionState(Panel::MINIMIZED); | 895 panel->SetExpansionState(Panel::MINIMIZED); |
895 EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state()); | 896 EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state()); |
896 gfx::Rect bounds = panel->GetBounds(); | 897 gfx::Rect bounds = panel->GetBounds(); |
897 gfx::Rect restored = panel->GetRestoredBounds(); | 898 gfx::Rect restored = panel->GetRestoredBounds(); |
898 EXPECT_EQ(bounds.x(), restored.x()); | 899 EXPECT_EQ(bounds.x(), restored.x()); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
943 panel->SetExpansionState(Panel::EXPANDED); | 944 panel->SetExpansionState(Panel::EXPANDED); |
944 bounds = gfx::Rect(40, 60, 300, 400); | 945 bounds = gfx::Rect(40, 60, 300, 400); |
945 panel->SetPanelBounds(bounds); | 946 panel->SetPanelBounds(bounds); |
946 EXPECT_NE(saved_restored_height, panel->GetRestoredBounds().height()); | 947 EXPECT_NE(saved_restored_height, panel->GetRestoredBounds().height()); |
947 EXPECT_EQ(0, panel_manager->minimized_panel_count()); | 948 EXPECT_EQ(0, panel_manager->minimized_panel_count()); |
948 | 949 |
949 panel->Close(); | 950 panel->Close(); |
950 } | 951 } |
951 | 952 |
952 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestore) { | 953 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestore) { |
953 // Disable mouse watcher. We'll simulate mouse movements for test. | 954 // We'll simulate mouse movements for test. |
954 PanelManager::GetInstance()->disable_mouse_watching(); | 955 PanelMouseWatcher* mouse_watcher = new TestPanelMouseWatcher(); |
956 PanelManager::GetInstance()->set_mouse_watcher(mouse_watcher); | |
955 | 957 |
956 // Test with one panel. | 958 // Test with one panel. |
957 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); | 959 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); |
958 TestMinimizeRestore(); | 960 TestMinimizeRestore(); |
959 | 961 |
962 PanelManager::GetInstance()->RemoveAll(); | |
963 } | |
964 | |
965 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestore2) { | |
jianli
2011/11/30 19:27:01
MinimizeRestore2 => MinimizeRestore2Panels
jennb
2011/11/30 19:55:12
Done.
| |
966 // We'll simulate mouse movements for test. | |
967 PanelMouseWatcher* mouse_watcher = new TestPanelMouseWatcher(); | |
968 PanelManager::GetInstance()->set_mouse_watcher(mouse_watcher); | |
969 | |
960 // Test with two panels. | 970 // Test with two panels. |
971 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); | |
961 CreatePanelWithBounds("PanelTest2", gfx::Rect(0, 0, 110, 110)); | 972 CreatePanelWithBounds("PanelTest2", gfx::Rect(0, 0, 110, 110)); |
962 TestMinimizeRestore(); | 973 TestMinimizeRestore(); |
963 | 974 |
975 PanelManager::GetInstance()->RemoveAll(); | |
976 } | |
977 | |
978 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestore3) { | |
jianli
2011/11/30 19:27:01
MinimizeRestore3 => MinimizeRestore3Panels
jennb
2011/11/30 19:55:12
Done.
| |
979 // We'll simulate mouse movements for test. | |
980 PanelMouseWatcher* mouse_watcher = new TestPanelMouseWatcher(); | |
981 PanelManager::GetInstance()->set_mouse_watcher(mouse_watcher); | |
982 | |
964 // Test with three panels. | 983 // Test with three panels. |
984 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); | |
985 CreatePanelWithBounds("PanelTest2", gfx::Rect(0, 0, 110, 110)); | |
965 CreatePanelWithBounds("PanelTest3", gfx::Rect(0, 0, 120, 120)); | 986 CreatePanelWithBounds("PanelTest3", gfx::Rect(0, 0, 120, 120)); |
966 TestMinimizeRestore(); | 987 TestMinimizeRestore(); |
967 | 988 |
968 PanelManager::GetInstance()->RemoveAll(); | 989 PanelManager::GetInstance()->RemoveAll(); |
969 } | 990 } |
970 | 991 |
971 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, ActivatePanelOrTabbedWindow) { | 992 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, ActivatePanelOrTabbedWindow) { |
972 CreatePanelParams params1("Panel1", gfx::Rect(), SHOW_AS_ACTIVE); | 993 CreatePanelParams params1("Panel1", gfx::Rect(), SHOW_AS_ACTIVE); |
973 Panel* panel1 = CreatePanelWithParams(params1); | 994 Panel* panel1 = CreatePanelWithParams(params1); |
974 CreatePanelParams params2("Panel2", gfx::Rect(), SHOW_AS_ACTIVE); | 995 CreatePanelParams params2("Panel2", gfx::Rect(), SHOW_AS_ACTIVE); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1112 EXPECT_FALSE(panel->IsDrawingAttention()); | 1133 EXPECT_FALSE(panel->IsDrawingAttention()); |
1113 panel->FlashFrame(); | 1134 panel->FlashFrame(); |
1114 EXPECT_TRUE(panel->IsDrawingAttention()); | 1135 EXPECT_TRUE(panel->IsDrawingAttention()); |
1115 MessageLoop::current()->RunAllPending(); | 1136 MessageLoop::current()->RunAllPending(); |
1116 EXPECT_TRUE(native_panel_testing->VerifyDrawingAttention()); | 1137 EXPECT_TRUE(native_panel_testing->VerifyDrawingAttention()); |
1117 | 1138 |
1118 panel->Close(); | 1139 panel->Close(); |
1119 } | 1140 } |
1120 | 1141 |
1121 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, DrawAttentionWhileMinimized) { | 1142 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, DrawAttentionWhileMinimized) { |
1143 // We'll simulate mouse movements for test. | |
1144 PanelMouseWatcher* mouse_watcher = new TestPanelMouseWatcher(); | |
1145 PanelManager::GetInstance()->set_mouse_watcher(mouse_watcher); | |
1146 | |
1122 CreatePanelParams params("Initially Active", gfx::Rect(), SHOW_AS_ACTIVE); | 1147 CreatePanelParams params("Initially Active", gfx::Rect(), SHOW_AS_ACTIVE); |
1123 Panel* panel = CreatePanelWithParams(params); | 1148 Panel* panel = CreatePanelWithParams(params); |
1124 NativePanel* native_panel = panel->native_panel(); | 1149 NativePanel* native_panel = panel->native_panel(); |
1125 scoped_ptr<NativePanelTesting> native_panel_testing( | 1150 scoped_ptr<NativePanelTesting> native_panel_testing( |
1126 NativePanelTesting::Create(native_panel)); | 1151 NativePanelTesting::Create(native_panel)); |
1127 | 1152 |
1128 // Test that the attention is drawn and the title-bar is brought up when the | 1153 // Test that the attention is drawn and the title-bar is brought up when the |
1129 // minimized panel is drawing attention. | 1154 // minimized panel is drawing attention. |
1130 panel->SetExpansionState(Panel::MINIMIZED); | 1155 panel->SetExpansionState(Panel::MINIMIZED); |
1131 WaitForPanelActiveState(panel, SHOW_AS_INACTIVE); | 1156 WaitForPanelActiveState(panel, SHOW_AS_INACTIVE); |
1132 EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state()); | 1157 EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state()); |
1133 panel->FlashFrame(); | 1158 panel->FlashFrame(); |
1134 EXPECT_TRUE(panel->IsDrawingAttention()); | 1159 EXPECT_TRUE(panel->IsDrawingAttention()); |
1135 EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state()); | 1160 EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state()); |
1136 MessageLoop::current()->RunAllPending(); | 1161 MessageLoop::current()->RunAllPending(); |
1137 EXPECT_TRUE(native_panel_testing->VerifyDrawingAttention()); | 1162 EXPECT_TRUE(native_panel_testing->VerifyDrawingAttention()); |
1138 | 1163 |
1139 // Test that we cannot bring up other minimized panel if the mouse is over | 1164 // Test that we cannot bring up other minimized panel if the mouse is over |
1140 // the panel that draws attension. | 1165 // the panel that draws attension. |
1141 EXPECT_FALSE(PanelManager::GetInstance()-> | 1166 gfx::Point hover_point(panel->GetBounds().origin()); |
1142 ShouldBringUpTitlebars(panel->GetBounds().x(), panel->GetBounds().y())); | 1167 MoveMouse(hover_point); |
1168 EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state()); | |
1143 | 1169 |
1144 // Test that we cannot bring down the panel that is drawing the attention. | 1170 // Test that we cannot bring down the panel that is drawing the attention. |
1145 PanelManager::GetInstance()->BringUpOrDownTitlebars(false); | 1171 hover_point.set_y(hover_point.y() - 200); |
1172 MoveMouse(hover_point); | |
1146 EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state()); | 1173 EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state()); |
1147 | 1174 |
1148 // Test that the attention is cleared when activated. | 1175 // Test that the attention is cleared when activated. |
1149 panel->Activate(); | 1176 panel->Activate(); |
1150 MessageLoop::current()->RunAllPending(); | 1177 MessageLoop::current()->RunAllPending(); |
1151 WaitForPanelActiveState(panel, SHOW_AS_ACTIVE); | 1178 WaitForPanelActiveState(panel, SHOW_AS_ACTIVE); |
1152 EXPECT_FALSE(panel->IsDrawingAttention()); | 1179 EXPECT_FALSE(panel->IsDrawingAttention()); |
1153 EXPECT_EQ(Panel::EXPANDED, panel->expansion_state()); | 1180 EXPECT_EQ(Panel::EXPANDED, panel->expansion_state()); |
1154 EXPECT_FALSE(native_panel_testing->VerifyDrawingAttention()); | 1181 EXPECT_FALSE(native_panel_testing->VerifyDrawingAttention()); |
1155 | 1182 |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1498 Browser* tabbed_browser = BrowserList::FindTabbedBrowser(profile, false); | 1525 Browser* tabbed_browser = BrowserList::FindTabbedBrowser(profile, false); |
1499 EXPECT_EQ(contents, tabbed_browser->GetSelectedTabContentsWrapper()); | 1526 EXPECT_EQ(contents, tabbed_browser->GetSelectedTabContentsWrapper()); |
1500 tabbed_browser->window()->Close(); | 1527 tabbed_browser->window()->Close(); |
1501 } | 1528 } |
1502 | 1529 |
1503 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, SizeClamping) { | 1530 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, SizeClamping) { |
1504 // Using '0' sizes is equivalent of not providing sizes in API and causes | 1531 // Using '0' sizes is equivalent of not providing sizes in API and causes |
1505 // minimum sizes to be applied to facilitate auto-sizing. | 1532 // minimum sizes to be applied to facilitate auto-sizing. |
1506 CreatePanelParams params("Panel", gfx::Rect(), SHOW_AS_ACTIVE); | 1533 CreatePanelParams params("Panel", gfx::Rect(), SHOW_AS_ACTIVE); |
1507 Panel* panel = CreatePanelWithParams(params); | 1534 Panel* panel = CreatePanelWithParams(params); |
1508 EXPECT_EQ(PanelManager::kPanelMinWidth, panel->GetBounds().width()); | 1535 EXPECT_EQ(panel->min_size().width(), panel->GetBounds().width()); |
jianli
2011/11/30 19:27:01
ditto.
| |
1509 EXPECT_EQ(PanelManager::kPanelMinHeight, panel->GetBounds().height()); | 1536 EXPECT_EQ(panel->min_size().height(), panel->GetBounds().height()); |
1537 int reasonable_width = panel->min_size().width() + 10; | |
1538 int reasonable_height = panel->min_size().height() + 20; | |
1539 | |
1510 panel->Close(); | 1540 panel->Close(); |
1511 | 1541 |
1512 // Using reasonable actual sizes should avoid clamping. | 1542 // Using reasonable actual sizes should avoid clamping. |
1513 int reasonable_width = PanelManager::kPanelMinWidth + 10; | |
1514 int reasonable_height = PanelManager::kPanelMinHeight + 20; | |
1515 CreatePanelParams params1("Panel1", | 1543 CreatePanelParams params1("Panel1", |
1516 gfx::Rect(0, 0, | 1544 gfx::Rect(0, 0, |
1517 reasonable_width, reasonable_height), | 1545 reasonable_width, reasonable_height), |
1518 SHOW_AS_ACTIVE); | 1546 SHOW_AS_ACTIVE); |
1519 panel = CreatePanelWithParams(params1); | 1547 panel = CreatePanelWithParams(params1); |
1520 EXPECT_EQ(reasonable_width, panel->GetBounds().width()); | 1548 EXPECT_EQ(reasonable_width, panel->GetBounds().width()); |
1521 EXPECT_EQ(reasonable_height, panel->GetBounds().height()); | 1549 EXPECT_EQ(reasonable_height, panel->GetBounds().height()); |
1522 panel->Close(); | 1550 panel->Close(); |
1523 | 1551 |
1524 // Using just one size should auto-compute some reasonable other size. | 1552 // Using just one size should auto-compute some reasonable other size. |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1888 // position when tall panel brings up its titlebar. | 1916 // position when tall panel brings up its titlebar. |
1889 CloseWindowAndWait(panel1->browser()); | 1917 CloseWindowAndWait(panel1->browser()); |
1890 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up, | 1918 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up, |
1891 GetBalloonBottomPosition(balloon)); | 1919 GetBalloonBottomPosition(balloon)); |
1892 | 1920 |
1893 // Closing the remaining tall panel should move the notification balloon back | 1921 // Closing the remaining tall panel should move the notification balloon back |
1894 // to its original position. | 1922 // to its original position. |
1895 CloseWindowAndWait(panel2->browser()); | 1923 CloseWindowAndWait(panel2->browser()); |
1896 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon)); | 1924 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon)); |
1897 } | 1925 } |
OLD | NEW |