| 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/string_number_conversions.h" | 6 #include "base/string_number_conversions.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/browser_list.h" | 9 #include "chrome/browser/browser_list.h" |
| 10 #include "chrome/browser/dom_operation_notification_details.h" | 10 #include "chrome/browser/dom_operation_notification_details.h" |
| 11 #include "chrome/browser/geolocation/arbitrator_dependency_factories_for_test.h" |
| 11 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 12 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" |
| 12 #include "chrome/browser/geolocation/geolocation_settings_state.h" | 13 #include "chrome/browser/geolocation/geolocation_settings_state.h" |
| 14 #include "chrome/browser/geolocation/location_arbitrator.h" |
| 15 #include "chrome/browser/geolocation/mock_location_provider.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/renderer_host/render_view_host.h" |
| 14 #include "chrome/browser/tab_contents/infobar_delegate.h" | 18 #include "chrome/browser/tab_contents/infobar_delegate.h" |
| 19 #include "chrome/browser/tab_contents/tab_contents.h" |
| 15 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/common/chrome_paths.h" | 21 #include "chrome/common/chrome_paths.h" |
| 17 #include "chrome/common/geoposition.h" | 22 #include "chrome/common/geoposition.h" |
| 18 #include "chrome/common/notification_details.h" | 23 #include "chrome/common/notification_details.h" |
| 19 #include "chrome/common/notification_service.h" | 24 #include "chrome/common/notification_service.h" |
| 20 #include "chrome/common/notification_type.h" | 25 #include "chrome/common/notification_type.h" |
| 21 #include "chrome/test/in_process_browser_test.h" | 26 #include "chrome/test/in_process_browser_test.h" |
| 22 #include "chrome/test/ui_test_utils.h" | 27 #include "chrome/test/ui_test_utils.h" |
| 23 #include "content/browser/geolocation/arbitrator_dependency_factories_for_test.h
" | |
| 24 #include "content/browser/geolocation/location_arbitrator.h" | |
| 25 #include "content/browser/geolocation/mock_location_provider.h" | |
| 26 #include "content/browser/renderer_host/render_view_host.h" | |
| 27 #include "content/browser/tab_contents/tab_contents.h" | |
| 28 #include "net/base/net_util.h" | 28 #include "net/base/net_util.h" |
| 29 #include "net/test/test_server.h" | 29 #include "net/test/test_server.h" |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 // Used to block until an iframe is loaded via a javascript call. | 33 // Used to block until an iframe is loaded via a javascript call. |
| 34 // Note: NavigateToURLBlockUntilNavigationsComplete doesn't seem to work for | 34 // Note: NavigateToURLBlockUntilNavigationsComplete doesn't seem to work for |
| 35 // multiple embedded iframes, as notifications seem to be 'batched'. Instead, we | 35 // multiple embedded iframes, as notifications seem to be 'batched'. Instead, we |
| 36 // load and wait one single frame here by calling a javascript function. | 36 // load and wait one single frame here by calling a javascript function. |
| 37 class IFrameLoader : public NotificationObserver { | 37 class IFrameLoader : public NotificationObserver { |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 "window.domAutomationController.setAutomationId(0);" | 642 "window.domAutomationController.setAutomationId(0);" |
| 643 "window.domAutomationController.send(window.close());"; | 643 "window.domAutomationController.send(window.close());"; |
| 644 bool result = | 644 bool result = |
| 645 ui_test_utils::ExecuteJavaScript( | 645 ui_test_utils::ExecuteJavaScript( |
| 646 current_browser_->GetSelectedTabContents()->render_view_host(), | 646 current_browser_->GetSelectedTabContents()->render_view_host(), |
| 647 L"", UTF8ToWide(script)); | 647 L"", UTF8ToWide(script)); |
| 648 EXPECT_EQ(result, true); | 648 EXPECT_EQ(result, true); |
| 649 } | 649 } |
| 650 | 650 |
| 651 } // namespace | 651 } // namespace |
| OLD | NEW |