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/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 // Disables further prompts from this iframe. | 576 // Disables further prompts from this iframe. |
577 CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)"); | 577 CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)"); |
578 | 578 |
579 // Test second iframe from a different origin with a cached geoposition will | 579 // Test second iframe from a different origin with a cached geoposition will |
580 // create the infobar. | 580 // create the infobar. |
581 iframe_xpath_ = "//iframe[@id='iframe_1']"; | 581 iframe_xpath_ = "//iframe[@id='iframe_1']"; |
582 AddGeolocationWatch(true); | 582 AddGeolocationWatch(true); |
583 | 583 |
584 InfoBarService* infobar_service = InfoBarService::FromWebContents( | 584 InfoBarService* infobar_service = InfoBarService::FromWebContents( |
585 current_browser_->tab_strip_model()->GetActiveWebContents()); | 585 current_browser_->tab_strip_model()->GetActiveWebContents()); |
586 size_t num_infobars_before_cancel = infobar_service->GetInfoBarCount(); | 586 size_t num_infobars_before_cancel = infobar_service->infobar_count(); |
587 // Change the iframe, and ensure the infobar is gone. | 587 // Change the iframe, and ensure the infobar is gone. |
588 IFrameLoader change_iframe_1(current_browser_, 1, current_url_); | 588 IFrameLoader change_iframe_1(current_browser_, 1, current_url_); |
589 size_t num_infobars_after_cancel = infobar_service->GetInfoBarCount(); | 589 size_t num_infobars_after_cancel = infobar_service->infobar_count(); |
590 EXPECT_EQ(num_infobars_before_cancel, num_infobars_after_cancel + 1); | 590 EXPECT_EQ(num_infobars_before_cancel, num_infobars_after_cancel + 1); |
591 } | 591 } |
592 | 592 |
593 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, InvalidUrlRequest) { | 593 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, InvalidUrlRequest) { |
594 // Tests that an invalid URL (e.g. from a popup window) is rejected | 594 // Tests that an invalid URL (e.g. from a popup window) is rejected |
595 // correctly. Also acts as a regression test for http://crbug.com/40478 | 595 // correctly. Also acts as a regression test for http://crbug.com/40478 |
596 html_for_tests_ = "files/geolocation/invalid_request_url.html"; | 596 html_for_tests_ = "files/geolocation/invalid_request_url.html"; |
597 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); | 597 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); |
598 WebContents* original_tab = | 598 WebContents* original_tab = |
599 current_browser_->tab_strip_model()->GetActiveWebContents(); | 599 current_browser_->tab_strip_model()->GetActiveWebContents(); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 std::string script = | 676 std::string script = |
677 "window.domAutomationController.send(window.close());"; | 677 "window.domAutomationController.send(window.close());"; |
678 bool result = | 678 bool result = |
679 content::ExecuteScript( | 679 content::ExecuteScript( |
680 current_browser_->tab_strip_model()->GetActiveWebContents(), | 680 current_browser_->tab_strip_model()->GetActiveWebContents(), |
681 script); | 681 script); |
682 EXPECT_EQ(result, true); | 682 EXPECT_EQ(result, true); |
683 } | 683 } |
684 | 684 |
685 } // namespace | 685 } // namespace |
OLD | NEW |