OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/content_settings/host_content_settings_map.h" | 11 #include "chrome/browser/content_settings/host_content_settings_map.h" |
12 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 12 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
13 #include "chrome/browser/geolocation/geolocation_settings_state.h" | 13 #include "chrome/browser/geolocation/geolocation_settings_state.h" |
14 #include "chrome/browser/infobars/infobar.h" | 14 #include "chrome/browser/infobars/infobar.h" |
15 #include "chrome/browser/infobars/infobar_tab_helper.h" | 15 #include "chrome/browser/infobars/infobar_tab_helper.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 17 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/browser_list.h" | 19 #include "chrome/browser/ui/browser_finder.h" |
20 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 20 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
21 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
22 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
23 #include "chrome/common/content_settings_pattern.h" | 23 #include "chrome/common/content_settings_pattern.h" |
24 #include "chrome/test/base/in_process_browser_test.h" | 24 #include "chrome/test/base/in_process_browser_test.h" |
25 #include "chrome/test/base/ui_test_utils.h" | 25 #include "chrome/test/base/ui_test_utils.h" |
26 #include "content/public/browser/dom_operation_notification_details.h" | 26 #include "content/public/browser/dom_operation_notification_details.h" |
27 #include "content/public/browser/navigation_controller.h" | 27 #include "content/public/browser/navigation_controller.h" |
28 #include "content/public/browser/notification_details.h" | 28 #include "content/public/browser/notification_details.h" |
29 #include "content/public/browser/notification_service.h" | 29 #include "content/public/browser/notification_service.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 if (!started_test_server_) | 231 if (!started_test_server_) |
232 started_test_server_ = test_server()->Start(); | 232 started_test_server_ = test_server()->Start(); |
233 EXPECT_TRUE(started_test_server_); | 233 EXPECT_TRUE(started_test_server_); |
234 if (!started_test_server_) | 234 if (!started_test_server_) |
235 return false; | 235 return false; |
236 | 236 |
237 current_url_ = test_server()->GetURL(html_for_tests_); | 237 current_url_ = test_server()->GetURL(html_for_tests_); |
238 LOG(WARNING) << "before navigate"; | 238 LOG(WARNING) << "before navigate"; |
239 if (options == INITIALIZATION_OFFTHERECORD) { | 239 if (options == INITIALIZATION_OFFTHERECORD) { |
240 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), current_url_); | 240 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), current_url_); |
241 current_browser_ = BrowserList::FindTabbedBrowser( | 241 current_browser_ = browser::FindTabbedBrowser( |
242 browser()->profile()->GetOffTheRecordProfile(), false); | 242 browser()->profile()->GetOffTheRecordProfile(), false); |
243 } else if (options == INITIALIZATION_NEWTAB) { | 243 } else if (options == INITIALIZATION_NEWTAB) { |
244 current_browser_ = browser(); | 244 current_browser_ = browser(); |
245 current_browser_->NewTab(); | 245 current_browser_->NewTab(); |
246 ui_test_utils::NavigateToURL(current_browser_, current_url_); | 246 ui_test_utils::NavigateToURL(current_browser_, current_url_); |
247 } else if (options == INITIALIZATION_IFRAMES) { | 247 } else if (options == INITIALIZATION_IFRAMES) { |
248 current_browser_ = browser(); | 248 current_browser_ = browser(); |
249 ui_test_utils::NavigateToURL(current_browser_, current_url_); | 249 ui_test_utils::NavigateToURL(current_browser_, current_url_); |
250 } else { | 250 } else { |
251 current_browser_ = browser(); | 251 current_browser_ = browser(); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 "window.domAutomationController.setAutomationId(0);" | 662 "window.domAutomationController.setAutomationId(0);" |
663 "window.domAutomationController.send(window.close());"; | 663 "window.domAutomationController.send(window.close());"; |
664 bool result = | 664 bool result = |
665 ui_test_utils::ExecuteJavaScript( | 665 ui_test_utils::ExecuteJavaScript( |
666 current_browser_->GetSelectedWebContents()->GetRenderViewHost(), | 666 current_browser_->GetSelectedWebContents()->GetRenderViewHost(), |
667 L"", UTF8ToWide(script)); | 667 L"", UTF8ToWide(script)); |
668 EXPECT_EQ(result, true); | 668 EXPECT_EQ(result, true); |
669 } | 669 } |
670 | 670 |
671 } // namespace | 671 } // namespace |
OLD | NEW |