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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/download/download_manager.h" | 6 #include "chrome/browser/download/download_manager.h" |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/browser/ui/browser_list.h" | 11 #include "chrome/browser/ui/browser_list.h" |
12 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
| 13 #include "chrome/browser/ui/find_bar/find_bar.h" |
| 14 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
13 #include "chrome/browser/ui/panels/panel.h" | 15 #include "chrome/browser/ui/panels/panel.h" |
14 #include "chrome/browser/ui/panels/panel_manager.h" | 16 #include "chrome/browser/ui/panels/panel_manager.h" |
15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
16 #include "chrome/browser/web_applications/web_app.h" | 18 #include "chrome/browser/web_applications/web_app.h" |
17 #include "chrome/common/chrome_notification_types.h" | 19 #include "chrome/common/chrome_notification_types.h" |
18 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/common/extensions/extension.h" | 21 #include "chrome/common/extensions/extension.h" |
20 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
21 #include "chrome/test/base/in_process_browser_test.h" | 23 #include "chrome/test/base/in_process_browser_test.h" |
22 #include "chrome/test/base/ui_test_utils.h" | 24 #include "chrome/test/base/ui_test_utils.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 gfx::Rect bounds = panel->GetBounds(); | 154 gfx::Rect bounds = panel->GetBounds(); |
153 EXPECT_GT(bounds.x(), 0); | 155 EXPECT_GT(bounds.x(), 0); |
154 EXPECT_GT(bounds.y(), 0); | 156 EXPECT_GT(bounds.y(), 0); |
155 EXPECT_GT(bounds.width(), 0); | 157 EXPECT_GT(bounds.width(), 0); |
156 EXPECT_GT(bounds.height(), 0); | 158 EXPECT_GT(bounds.height(), 0); |
157 | 159 |
158 panel->Close(); | 160 panel->Close(); |
159 EXPECT_EQ(0, panel_manager->num_panels()); | 161 EXPECT_EQ(0, panel_manager->num_panels()); |
160 } | 162 } |
161 | 163 |
| 164 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, FindBar) { |
| 165 Panel* panel = CreatePanel("PanelTest", gfx::Rect(0, 0, 400, 400)); |
| 166 Browser* browser = panel->browser(); |
| 167 browser->ShowFindBar(); |
| 168 ASSERT_TRUE(browser->GetFindBarController()->find_bar()->IsFindBarVisible()); |
| 169 panel->Close(); |
| 170 } |
| 171 |
162 // TODO(jianli): Investigate and enable it for Mac. | 172 // TODO(jianli): Investigate and enable it for Mac. |
163 #ifdef OS_MACOSX | 173 #ifdef OS_MACOSX |
164 #define MAYBE_CreatePanelOnOverflow DISABLED_CreatePanelOnOverflow | 174 #define MAYBE_CreatePanelOnOverflow DISABLED_CreatePanelOnOverflow |
165 #else | 175 #else |
166 #define MAYBE_CreatePanelOnOverflow CreatePanelOnOverflow | 176 #define MAYBE_CreatePanelOnOverflow CreatePanelOnOverflow |
167 #endif | 177 #endif |
168 | 178 |
169 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MAYBE_CreatePanelOnOverflow) { | 179 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MAYBE_CreatePanelOnOverflow) { |
170 TestCreatePanelOnOverflow(); | 180 TestCreatePanelOnOverflow(); |
171 } | 181 } |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 EXPECT_EQ(1, tabbed_browser->tab_count()); | 337 EXPECT_EQ(1, tabbed_browser->tab_count()); |
328 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible()); | 338 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible()); |
329 tabbed_browser->CloseWindow(); | 339 tabbed_browser->CloseWindow(); |
330 #endif | 340 #endif |
331 | 341 |
332 EXPECT_EQ(1, panel_browser->tab_count()); | 342 EXPECT_EQ(1, panel_browser->tab_count()); |
333 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible()); | 343 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible()); |
334 | 344 |
335 panel_browser->CloseWindow(); | 345 panel_browser->CloseWindow(); |
336 } | 346 } |
OLD | NEW |