| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, InvalidUrlRequest) { | 545 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, InvalidUrlRequest) { |
| 546 // Tests that an invalid URL (e.g. from a popup window) is rejected | 546 // Tests that an invalid URL (e.g. from a popup window) is rejected |
| 547 // correctly. Also acts as a regression test for http://crbug.com/40478 | 547 // correctly. Also acts as a regression test for http://crbug.com/40478 |
| 548 html_for_tests_ = "files/geolocation/invalid_request_url.html"; | 548 html_for_tests_ = "files/geolocation/invalid_request_url.html"; |
| 549 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); | 549 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); |
| 550 TabContents* original_tab = current_browser_->GetSelectedTabContents(); | 550 TabContents* original_tab = current_browser_->GetSelectedTabContents(); |
| 551 CheckStringValueFromJavascript("1", "requestGeolocationFromInvalidUrl()"); | 551 CheckStringValueFromJavascript("1", "requestGeolocationFromInvalidUrl()"); |
| 552 CheckStringValueFromJavascriptForTab("1", "isAlive()", original_tab); | 552 CheckStringValueFromJavascriptForTab("1", "isAlive()", original_tab); |
| 553 } | 553 } |
| 554 | 554 |
| 555 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, NoInfoBarBeforeStart) { | 555 // Crashy, http://crbug.com/66400. |
| 556 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, DISABLED_NoInfoBarBeforeStart) { |
| 556 // See http://crbug.com/42789 | 557 // See http://crbug.com/42789 |
| 557 html_for_tests_ = "files/geolocation/iframes_different_origin.html"; | 558 html_for_tests_ = "files/geolocation/iframes_different_origin.html"; |
| 558 ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES)); | 559 ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES)); |
| 559 LOG(WARNING) << "frames loaded"; | 560 LOG(WARNING) << "frames loaded"; |
| 560 | 561 |
| 561 // Access navigator.geolocation, but ensure it won't request permission. | 562 // Access navigator.geolocation, but ensure it won't request permission. |
| 562 iframe_xpath_ = L"//iframe[@id='iframe_1']"; | 563 iframe_xpath_ = L"//iframe[@id='iframe_1']"; |
| 563 CheckStringValueFromJavascript("object", "geoAccessNavigatorGeolocation()"); | 564 CheckStringValueFromJavascript("object", "geoAccessNavigatorGeolocation()"); |
| 564 | 565 |
| 565 iframe_xpath_ = L"//iframe[@id='iframe_0']"; | 566 iframe_xpath_ = L"//iframe[@id='iframe_0']"; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 593 AddGeolocationWatch(true); | 594 AddGeolocationWatch(true); |
| 594 SetInfobarResponse(current_url_, true); | 595 SetInfobarResponse(current_url_, true); |
| 595 CheckGeoposition(MockLocationProvider::instance_->position_); | 596 CheckGeoposition(MockLocationProvider::instance_->position_); |
| 596 | 597 |
| 597 // The second watch will now have cancelled. Ensure an update still makes | 598 // The second watch will now have cancelled. Ensure an update still makes |
| 598 // its way through to the first watcher. | 599 // its way through to the first watcher. |
| 599 NotifyGeoposition(final_position); | 600 NotifyGeoposition(final_position); |
| 600 WaitForNavigation(); | 601 WaitForNavigation(); |
| 601 CheckGeoposition(final_position); | 602 CheckGeoposition(final_position); |
| 602 } | 603 } |
| OLD | NEW |