| 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/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
| 6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 10 #include "chrome/browser/dom_operation_notification_details.h" | 10 #include "chrome/browser/dom_operation_notification_details.h" |
| 11 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 11 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" |
| 12 #include "chrome/browser/geolocation/geolocation_settings_state.h" | 12 #include "chrome/browser/geolocation/geolocation_settings_state.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 14 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
| 15 #include "chrome/browser/tab_contents/infobar.h" |
| 15 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/browser/ui/browser_list.h" | 17 #include "chrome/browser/ui/browser_list.h" |
| 17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 18 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
| 19 #include "chrome/test/in_process_browser_test.h" | 20 #include "chrome/test/in_process_browser_test.h" |
| 20 #include "chrome/test/ui_test_utils.h" | 21 #include "chrome/test/ui_test_utils.h" |
| 21 #include "content/browser/geolocation/arbitrator_dependency_factories_for_test.h
" | 22 #include "content/browser/geolocation/arbitrator_dependency_factories_for_test.h
" |
| 22 #include "content/browser/geolocation/location_arbitrator.h" | 23 #include "content/browser/geolocation/location_arbitrator.h" |
| 23 #include "content/browser/geolocation/mock_location_provider.h" | 24 #include "content/browser/geolocation/mock_location_provider.h" |
| 24 #include "content/browser/renderer_host/render_view_host.h" | 25 #include "content/browser/renderer_host/render_view_host.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } else { | 144 } else { |
| 144 EXPECT_TRUE(navigation_completed_); | 145 EXPECT_TRUE(navigation_completed_); |
| 145 } | 146 } |
| 146 } | 147 } |
| 147 | 148 |
| 148 // NotificationObserver | 149 // NotificationObserver |
| 149 virtual void Observe(NotificationType type, | 150 virtual void Observe(NotificationType type, |
| 150 const NotificationSource& source, | 151 const NotificationSource& source, |
| 151 const NotificationDetails& details) { | 152 const NotificationDetails& details) { |
| 152 if (type.value == NotificationType::TAB_CONTENTS_INFOBAR_ADDED) { | 153 if (type.value == NotificationType::TAB_CONTENTS_INFOBAR_ADDED) { |
| 153 infobar_ = Details<InfoBarDelegate>(details).ptr(); | 154 infobar_ = Details<InfoBar>(details).ptr()->delegate(); |
| 154 ASSERT_TRUE(infobar_->GetIcon()); | 155 ASSERT_TRUE(infobar_->GetIcon()); |
| 155 ASSERT_TRUE(infobar_->AsConfirmInfoBarDelegate()); | 156 ASSERT_TRUE(infobar_->AsConfirmInfoBarDelegate()); |
| 156 } else if (type == NotificationType::DOM_OPERATION_RESPONSE) { | 157 } else if (type == NotificationType::DOM_OPERATION_RESPONSE) { |
| 157 Details<DomOperationNotificationDetails> dom_op_details(details); | 158 Details<DomOperationNotificationDetails> dom_op_details(details); |
| 158 javascript_response_ = dom_op_details->json(); | 159 javascript_response_ = dom_op_details->json(); |
| 159 LOG(WARNING) << "javascript_response " << javascript_response_; | 160 LOG(WARNING) << "javascript_response " << javascript_response_; |
| 160 } else if (type == NotificationType::NAV_ENTRY_COMMITTED || | 161 } else if (type == NotificationType::NAV_ENTRY_COMMITTED || |
| 161 type == NotificationType::LOAD_START) { | 162 type == NotificationType::LOAD_START) { |
| 162 navigation_started_ = true; | 163 navigation_started_ = true; |
| 163 } else if (type == NotificationType::LOAD_STOP) { | 164 } else if (type == NotificationType::LOAD_STOP) { |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 "window.domAutomationController.setAutomationId(0);" | 645 "window.domAutomationController.setAutomationId(0);" |
| 645 "window.domAutomationController.send(window.close());"; | 646 "window.domAutomationController.send(window.close());"; |
| 646 bool result = | 647 bool result = |
| 647 ui_test_utils::ExecuteJavaScript( | 648 ui_test_utils::ExecuteJavaScript( |
| 648 current_browser_->GetSelectedTabContents()->render_view_host(), | 649 current_browser_->GetSelectedTabContents()->render_view_host(), |
| 649 L"", UTF8ToWide(script)); | 650 L"", UTF8ToWide(script)); |
| 650 EXPECT_EQ(result, true); | 651 EXPECT_EQ(result, true); |
| 651 } | 652 } |
| 652 | 653 |
| 653 } // namespace | 654 } // namespace |
| OLD | NEW |