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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 SetInfobarResponse(current_url_, true); | 455 SetInfobarResponse(current_url_, true); |
456 CheckGeoposition(fake_latitude_, fake_longitude_); | 456 CheckGeoposition(fake_latitude_, fake_longitude_); |
457 // Disables further prompts from this tab. | 457 // Disables further prompts from this tab. |
458 CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)"); | 458 CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)"); |
459 // Go incognito, and checks no infobar will be created. | 459 // Go incognito, and checks no infobar will be created. |
460 ASSERT_TRUE(Initialize(INITIALIZATION_OFFTHERECORD)); | 460 ASSERT_TRUE(Initialize(INITIALIZATION_OFFTHERECORD)); |
461 AddGeolocationWatch(false); | 461 AddGeolocationWatch(false); |
462 CheckGeoposition(fake_latitude_, fake_longitude_); | 462 CheckGeoposition(fake_latitude_, fake_longitude_); |
463 } | 463 } |
464 | 464 |
465 // Test fails: http://crbug.com/90927 | |
466 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, | 465 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, |
467 DISABLED_IFramesWithFreshPosition) { | 466 IFramesWithFreshPosition) { |
468 html_for_tests_ = "files/geolocation/iframes_different_origin.html"; | 467 html_for_tests_ = "files/geolocation/iframes_different_origin.html"; |
469 ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES)); | 468 ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES)); |
470 LoadIFrames(2); | 469 LoadIFrames(2); |
471 LOG(WARNING) << "frames loaded"; | 470 LOG(WARNING) << "frames loaded"; |
472 | 471 |
473 iframe_xpath_ = L"//iframe[@id='iframe_0']"; | 472 iframe_xpath_ = L"//iframe[@id='iframe_0']"; |
474 AddGeolocationWatch(true); | 473 AddGeolocationWatch(true); |
475 SetInfobarResponse(iframe_urls_[0], true); | 474 SetInfobarResponse(iframe_urls_[0], true); |
476 CheckGeoposition(fake_latitude_, fake_longitude_); | 475 CheckGeoposition(fake_latitude_, fake_longitude_); |
477 // Disables further prompts from this iframe. | 476 // Disables further prompts from this iframe. |
(...skipping 22 matching lines...) Expand all Loading... |
500 | 499 |
501 // Now go ahead an authorize the second frame. | 500 // Now go ahead an authorize the second frame. |
502 iframe_xpath_ = L"//iframe[@id='iframe_1']"; | 501 iframe_xpath_ = L"//iframe[@id='iframe_1']"; |
503 // Infobar was displayed, allow access and check there's no error code. | 502 // Infobar was displayed, allow access and check there's no error code. |
504 SetInfobarResponse(iframe_urls_[1], true); | 503 SetInfobarResponse(iframe_urls_[1], true); |
505 LOG(WARNING) << "Checking position..."; | 504 LOG(WARNING) << "Checking position..."; |
506 CheckGeoposition(fresh_position_latitude, fresh_position_longitude); | 505 CheckGeoposition(fresh_position_latitude, fresh_position_longitude); |
507 LOG(WARNING) << "...done."; | 506 LOG(WARNING) << "...done."; |
508 } | 507 } |
509 | 508 |
510 // Test fails: http://crbug.com/90927 | |
511 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, | 509 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, |
512 DISABLED_IFramesWithCachedPosition) { | 510 IFramesWithCachedPosition) { |
513 html_for_tests_ = "files/geolocation/iframes_different_origin.html"; | 511 html_for_tests_ = "files/geolocation/iframes_different_origin.html"; |
514 ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES)); | 512 ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES)); |
515 LoadIFrames(2); | 513 LoadIFrames(2); |
516 | 514 |
517 iframe_xpath_ = L"//iframe[@id='iframe_0']"; | 515 iframe_xpath_ = L"//iframe[@id='iframe_0']"; |
518 AddGeolocationWatch(true); | 516 AddGeolocationWatch(true); |
519 SetInfobarResponse(iframe_urls_[0], true); | 517 SetInfobarResponse(iframe_urls_[0], true); |
520 CheckGeoposition(fake_latitude_, fake_longitude_); | 518 CheckGeoposition(fake_latitude_, fake_longitude_); |
521 | 519 |
522 // Refresh geoposition, but let's not yet create the watch on the second frame | 520 // Refresh geoposition, but let's not yet create the watch on the second frame |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 "window.domAutomationController.setAutomationId(0);" | 657 "window.domAutomationController.setAutomationId(0);" |
660 "window.domAutomationController.send(window.close());"; | 658 "window.domAutomationController.send(window.close());"; |
661 bool result = | 659 bool result = |
662 content::ExecuteJavaScript( | 660 content::ExecuteJavaScript( |
663 chrome::GetActiveWebContents(current_browser_)->GetRenderViewHost(), | 661 chrome::GetActiveWebContents(current_browser_)->GetRenderViewHost(), |
664 L"", UTF8ToWide(script)); | 662 L"", UTF8ToWide(script)); |
665 EXPECT_EQ(result, true); | 663 EXPECT_EQ(result, true); |
666 } | 664 } |
667 | 665 |
668 } // namespace | 666 } // namespace |
OLD | NEW |