Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4968)

Unified Diff: chrome/browser/geolocation/geolocation_browsertest.cc

Issue 13548003: Prevent leaking geolocation permission from Incognito (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/geolocation/geolocation_browsertest.cc
diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc
index 2062dfef2565feedc4887b45f752d53a1313323f..2377599a70e062d063b6cc08423a30441a723949 100644
--- a/chrome/browser/geolocation/geolocation_browsertest.cc
+++ b/chrome/browser/geolocation/geolocation_browsertest.cc
@@ -461,6 +461,21 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, NoInfobarForOffTheRecord) {
CheckGeoposition(fake_latitude_, fake_longitude_);
}
+IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, NoLeakFromOffTheRecord) {
+ // First, check infobar will be created for incognito profile.
+ ASSERT_TRUE(Initialize(INITIALIZATION_OFFTHERECORD));
+ AddGeolocationWatch(true);
+ // Response won't be persisted.
+ SetInfobarResponse(current_url_, true);
+ CheckGeoposition(fake_latitude_, fake_longitude_);
+ // Disables further prompts from this tab.
+ CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)");
+ // Go to the regular profile, infobar will be created.
+ ASSERT_TRUE(Initialize(INITIALIZATION_NONE));
+ AddGeolocationWatch(true);
+ 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.
+}
+
// crbug.com/176291
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest,
DISABLED_IFramesWithFreshPosition) {

Powered by Google App Engine
This is Rietveld 408576698