| 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" |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 | 446 |
| 447 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, NoInfobarForOffTheRecord) { | 447 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, NoInfobarForOffTheRecord) { |
| 448 // First, check infobar will be created for regular profile | 448 // First, check infobar will be created for regular profile |
| 449 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); | 449 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); |
| 450 AddGeolocationWatch(true); | 450 AddGeolocationWatch(true); |
| 451 // Response will be persisted | 451 // Response will be persisted |
| 452 SetInfobarResponse(current_url_, true); | 452 SetInfobarResponse(current_url_, true); |
| 453 CheckGeoposition(MockLocationProvider::instance_->position_); | 453 CheckGeoposition(MockLocationProvider::instance_->position_); |
| 454 // Disables further prompts from this tab. | 454 // Disables further prompts from this tab. |
| 455 CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)"); | 455 CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)"); |
| 456 // Go off the record, and checks no infobar will be created. | 456 // Go incognito, and checks no infobar will be created. |
| 457 ASSERT_TRUE(Initialize(INITIALIZATION_OFFTHERECORD)); | 457 ASSERT_TRUE(Initialize(INITIALIZATION_OFFTHERECORD)); |
| 458 AddGeolocationWatch(false); | 458 AddGeolocationWatch(false); |
| 459 CheckGeoposition(MockLocationProvider::instance_->position_); | 459 CheckGeoposition(MockLocationProvider::instance_->position_); |
| 460 } | 460 } |
| 461 | 461 |
| 462 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, IFramesWithFreshPosition) { | 462 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, IFramesWithFreshPosition) { |
| 463 html_for_tests_ = "files/geolocation/iframes_different_origin.html"; | 463 html_for_tests_ = "files/geolocation/iframes_different_origin.html"; |
| 464 ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES)); | 464 ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES)); |
| 465 LoadIFrames(2); | 465 LoadIFrames(2); |
| 466 LOG(WARNING) << "frames loaded"; | 466 LOG(WARNING) << "frames loaded"; |
| (...skipping 175 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 |