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 "chrome/browser/ui/panels/base_panel_browser_test.h" | 5 #include "chrome/browser/ui/panels/base_panel_browser_test.h" |
6 | 6 |
7 #include "chrome/browser/ui/browser_list.h" | 7 #include "chrome/browser/ui/browser_list.h" |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/mac/scoped_nsautorelease_pool.h" | 10 #include "base/mac/scoped_nsautorelease_pool.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/panels/native_panel.h" | 15 #include "chrome/browser/ui/panels/native_panel.h" |
16 #include "chrome/browser/ui/panels/panel_manager.h" | 16 #include "chrome/browser/ui/panels/panel_manager.h" |
17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
18 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/test/base/ui_test_utils.h" | 19 #include "chrome/test/base/ui_test_utils.h" |
20 #include "content/browser/tab_contents/test_tab_contents.h" | 20 #include "content/browser/tab_contents/test_tab_contents.h" |
| 21 #include "content/public/browser/notification_service.h" |
21 #include "content/public/common/url_constants.h" | 22 #include "content/public/common/url_constants.h" |
22 | 23 |
23 #if defined(OS_MACOSX) | 24 #if defined(OS_MACOSX) |
24 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" | 25 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
25 #endif | 26 #endif |
26 | 27 |
27 namespace { | 28 namespace { |
28 | 29 |
29 const int kTestingWorkAreaWidth = 800; | 30 const int kTestingWorkAreaWidth = 800; |
30 const int kTestingWorkAreaHeight = 600; | 31 const int kTestingWorkAreaHeight = 600; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 browser()->profile()); | 240 browser()->profile()); |
240 EXPECT_TRUE(panel_browser->is_type_panel()); | 241 EXPECT_TRUE(panel_browser->is_type_panel()); |
241 | 242 |
242 if (params.url.is_empty()) { | 243 if (params.url.is_empty()) { |
243 TabContentsWrapper* tab_contents = | 244 TabContentsWrapper* tab_contents = |
244 new TabContentsWrapper(new TestTabContents(browser()->profile(), NULL)); | 245 new TabContentsWrapper(new TestTabContents(browser()->profile(), NULL)); |
245 panel_browser->AddTab(tab_contents, content::PAGE_TRANSITION_LINK); | 246 panel_browser->AddTab(tab_contents, content::PAGE_TRANSITION_LINK); |
246 } else { | 247 } else { |
247 ui_test_utils::WindowedNotificationObserver observer( | 248 ui_test_utils::WindowedNotificationObserver observer( |
248 content::NOTIFICATION_LOAD_STOP, | 249 content::NOTIFICATION_LOAD_STOP, |
249 NotificationService::AllSources()); | 250 content::NotificationService::AllSources()); |
250 panel_browser->AddSelectedTabWithURL(params.url, | 251 panel_browser->AddSelectedTabWithURL(params.url, |
251 content::PAGE_TRANSITION_START_PAGE); | 252 content::PAGE_TRANSITION_START_PAGE); |
252 observer.Wait(); | 253 observer.Wait(); |
253 } | 254 } |
254 | 255 |
255 Panel* panel = static_cast<Panel*>(panel_browser->window()); | 256 Panel* panel = static_cast<Panel*>(panel_browser->window()); |
256 | 257 |
257 if (params.show_flag == SHOW_AS_ACTIVE) { | 258 if (params.show_flag == SHOW_AS_ACTIVE) { |
258 panel->Show(); | 259 panel->Show(); |
259 } else { | 260 } else { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 std::string error; | 325 std::string error; |
325 scoped_refptr<Extension> extension = Extension::Create( | 326 scoped_refptr<Extension> extension = Extension::Create( |
326 full_path, location, *input_value, | 327 full_path, location, *input_value, |
327 Extension::STRICT_ERROR_CHECKS, &error); | 328 Extension::STRICT_ERROR_CHECKS, &error); |
328 EXPECT_TRUE(extension.get()); | 329 EXPECT_TRUE(extension.get()); |
329 EXPECT_STREQ("", error.c_str()); | 330 EXPECT_STREQ("", error.c_str()); |
330 browser()->GetProfile()->GetExtensionService()->OnLoadSingleExtension( | 331 browser()->GetProfile()->GetExtensionService()->OnLoadSingleExtension( |
331 extension.get(), false); | 332 extension.get(), false); |
332 return extension; | 333 return extension; |
333 } | 334 } |
OLD | NEW |