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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 // Disables further prompts from this iframe. | 561 // Disables further prompts from this iframe. |
562 CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)"); | 562 CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)"); |
563 | 563 |
564 // Test second iframe from a different origin with a cached geoposition will | 564 // Test second iframe from a different origin with a cached geoposition will |
565 // create the infobar. | 565 // create the infobar. |
566 iframe_xpath_ = L"//iframe[@id='iframe_1']"; | 566 iframe_xpath_ = L"//iframe[@id='iframe_1']"; |
567 AddGeolocationWatch(true); | 567 AddGeolocationWatch(true); |
568 | 568 |
569 InfoBarTabHelper* infobar_helper = | 569 InfoBarTabHelper* infobar_helper = |
570 chrome::GetActiveTabContents(current_browser_)->infobar_tab_helper(); | 570 chrome::GetActiveTabContents(current_browser_)->infobar_tab_helper(); |
571 size_t num_infobars_before_cancel = infobar_helper->infobar_count(); | 571 size_t num_infobars_before_cancel = infobar_helper->GetInfoBarCount(); |
572 // Change the iframe, and ensure the infobar is gone. | 572 // Change the iframe, and ensure the infobar is gone. |
573 IFrameLoader change_iframe_1(current_browser_, 1, current_url_); | 573 IFrameLoader change_iframe_1(current_browser_, 1, current_url_); |
574 size_t num_infobars_after_cancel = infobar_helper->infobar_count(); | 574 size_t num_infobars_after_cancel = infobar_helper->GetInfoBarCount(); |
575 EXPECT_EQ(num_infobars_before_cancel, num_infobars_after_cancel + 1); | 575 EXPECT_EQ(num_infobars_before_cancel, num_infobars_after_cancel + 1); |
576 } | 576 } |
577 | 577 |
578 // Disabled, http://crbug.com/66959. | 578 // Disabled, http://crbug.com/66959. |
579 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, DISABLED_InvalidUrlRequest) { | 579 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, DISABLED_InvalidUrlRequest) { |
580 // Tests that an invalid URL (e.g. from a popup window) is rejected | 580 // Tests that an invalid URL (e.g. from a popup window) is rejected |
581 // correctly. Also acts as a regression test for http://crbug.com/40478 | 581 // correctly. Also acts as a regression test for http://crbug.com/40478 |
582 html_for_tests_ = "files/geolocation/invalid_request_url.html"; | 582 html_for_tests_ = "files/geolocation/invalid_request_url.html"; |
583 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); | 583 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); |
584 WebContents* original_tab = chrome::GetActiveWebContents(current_browser_); | 584 WebContents* original_tab = chrome::GetActiveWebContents(current_browser_); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 "window.domAutomationController.setAutomationId(0);" | 660 "window.domAutomationController.setAutomationId(0);" |
661 "window.domAutomationController.send(window.close());"; | 661 "window.domAutomationController.send(window.close());"; |
662 bool result = | 662 bool result = |
663 content::ExecuteJavaScript( | 663 content::ExecuteJavaScript( |
664 chrome::GetActiveWebContents(current_browser_)->GetRenderViewHost(), | 664 chrome::GetActiveWebContents(current_browser_)->GetRenderViewHost(), |
665 L"", UTF8ToWide(script)); | 665 L"", UTF8ToWide(script)); |
666 EXPECT_EQ(result, true); | 666 EXPECT_EQ(result, true); |
667 } | 667 } |
668 | 668 |
669 } // namespace | 669 } // namespace |
OLD | NEW |