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" |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, InvalidUrlRequest) { | 567 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, InvalidUrlRequest) { |
568 // Tests that an invalid URL (e.g. from a popup window) is rejected | 568 // Tests that an invalid URL (e.g. from a popup window) is rejected |
569 // correctly. Also acts as a regression test for http://crbug.com/40478 | 569 // correctly. Also acts as a regression test for http://crbug.com/40478 |
570 html_for_tests_ = "files/geolocation/invalid_request_url.html"; | 570 html_for_tests_ = "files/geolocation/invalid_request_url.html"; |
571 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); | 571 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); |
572 WebContents* original_tab = chrome::GetActiveWebContents(current_browser_); | 572 WebContents* original_tab = chrome::GetActiveWebContents(current_browser_); |
573 CheckStringValueFromJavascript("1", "requestGeolocationFromInvalidUrl()"); | 573 CheckStringValueFromJavascript("1", "requestGeolocationFromInvalidUrl()"); |
574 CheckStringValueFromJavascriptForTab("1", "isAlive()", original_tab); | 574 CheckStringValueFromJavascriptForTab("1", "isAlive()", original_tab); |
575 } | 575 } |
576 | 576 |
577 // Crashy, http://crbug.com/66400. | 577 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, NoInfoBarBeforeStart) { |
578 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, DISABLED_NoInfoBarBeforeStart) { | |
579 // See http://crbug.com/42789 | 578 // See http://crbug.com/42789 |
580 html_for_tests_ = "files/geolocation/iframes_different_origin.html"; | 579 html_for_tests_ = "files/geolocation/iframes_different_origin.html"; |
581 ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES)); | 580 ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES)); |
582 LoadIFrames(2); | 581 LoadIFrames(2); |
583 LOG(WARNING) << "frames loaded"; | 582 LOG(WARNING) << "frames loaded"; |
584 | 583 |
585 // Access navigator.geolocation, but ensure it won't request permission. | 584 // Access navigator.geolocation, but ensure it won't request permission. |
586 iframe_xpath_ = L"//iframe[@id='iframe_1']"; | 585 iframe_xpath_ = L"//iframe[@id='iframe_1']"; |
587 CheckStringValueFromJavascript("object", "geoAccessNavigatorGeolocation()"); | 586 CheckStringValueFromJavascript("object", "geoAccessNavigatorGeolocation()"); |
588 | 587 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 "window.domAutomationController.setAutomationId(0);" | 647 "window.domAutomationController.setAutomationId(0);" |
649 "window.domAutomationController.send(window.close());"; | 648 "window.domAutomationController.send(window.close());"; |
650 bool result = | 649 bool result = |
651 content::ExecuteJavaScript( | 650 content::ExecuteJavaScript( |
652 chrome::GetActiveWebContents(current_browser_)->GetRenderViewHost(), | 651 chrome::GetActiveWebContents(current_browser_)->GetRenderViewHost(), |
653 L"", UTF8ToWide(script)); | 652 L"", UTF8ToWide(script)); |
654 EXPECT_EQ(result, true); | 653 EXPECT_EQ(result, true); |
655 } | 654 } |
656 | 655 |
657 } // namespace | 656 } // namespace |
OLD | NEW |