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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
454 SetInfobarResponse(current_url_, true); | 454 SetInfobarResponse(current_url_, true); |
455 CheckGeoposition(fake_latitude_, fake_longitude_); | 455 CheckGeoposition(fake_latitude_, fake_longitude_); |
456 // Disables further prompts from this tab. | 456 // Disables further prompts from this tab. |
457 CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)"); | 457 CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)"); |
458 // Go incognito, and checks no infobar will be created. | 458 // Go incognito, and checks no infobar will be created. |
459 ASSERT_TRUE(Initialize(INITIALIZATION_OFFTHERECORD)); | 459 ASSERT_TRUE(Initialize(INITIALIZATION_OFFTHERECORD)); |
460 AddGeolocationWatch(false); | 460 AddGeolocationWatch(false); |
461 CheckGeoposition(fake_latitude_, fake_longitude_); | 461 CheckGeoposition(fake_latitude_, fake_longitude_); |
462 } | 462 } |
463 | 463 |
464 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, NoLeakFromOffTheRecord) { | |
465 // First, check infobar will be created for incognito profile. | |
466 ASSERT_TRUE(Initialize(INITIALIZATION_OFFTHERECORD)); | |
467 AddGeolocationWatch(true); | |
468 // Response won't be persisted. | |
469 SetInfobarResponse(current_url_, true); | |
470 CheckGeoposition(fake_latitude_, fake_longitude_); | |
471 // Disables further prompts from this tab. | |
472 CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)"); | |
473 // Go to the regular profile, infobar will be created. | |
474 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); | |
475 AddGeolocationWatch(true); | |
476 SetInfobarResponse(current_url_, false); | |
markusheintz_
2013/04/04 11:27:02
Should we also check here that the location can't
vasilii
2013/04/04 12:11:26
Done.
| |
477 } | |
478 | |
464 // crbug.com/176291 | 479 // crbug.com/176291 |
465 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, | 480 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, |
466 DISABLED_IFramesWithFreshPosition) { | 481 DISABLED_IFramesWithFreshPosition) { |
467 html_for_tests_ = "files/geolocation/iframes_different_origin.html"; | 482 html_for_tests_ = "files/geolocation/iframes_different_origin.html"; |
468 ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES)); | 483 ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES)); |
469 LoadIFrames(2); | 484 LoadIFrames(2); |
470 LOG(WARNING) << "frames loaded"; | 485 LOG(WARNING) << "frames loaded"; |
471 | 486 |
472 iframe_xpath_ = "//iframe[@id='iframe_0']"; | 487 iframe_xpath_ = "//iframe[@id='iframe_0']"; |
473 AddGeolocationWatch(true); | 488 AddGeolocationWatch(true); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
660 std::string script = | 675 std::string script = |
661 "window.domAutomationController.send(window.close());"; | 676 "window.domAutomationController.send(window.close());"; |
662 bool result = | 677 bool result = |
663 content::ExecuteScript( | 678 content::ExecuteScript( |
664 current_browser_->tab_strip_model()->GetActiveWebContents(), | 679 current_browser_->tab_strip_model()->GetActiveWebContents(), |
665 script); | 680 script); |
666 EXPECT_EQ(result, true); | 681 EXPECT_EQ(result, true); |
667 } | 682 } |
668 | 683 |
669 } // namespace | 684 } // namespace |
OLD | NEW |