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

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

Issue 1690043004: Use GURLs instead of patterns in SetContentSetting() in geolocation and push_messaging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scoping_set_content_setting
Patch Set: Created 4 years, 10 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 e6437ce8badbbd74eddfbf7096a45adca8221b03..4b05579130c16bc6d1d2a1f5bc4c0f182be75a2a 100644
--- a/chrome/browser/geolocation/geolocation_browsertest.cc
+++ b/chrome/browser/geolocation/geolocation_browsertest.cc
@@ -479,10 +479,9 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_NoPromptForSecondTab) {
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, NoPromptForDeniedOrigin) {
ASSERT_NO_FATAL_FAILURE(Initialize(INITIALIZATION_DEFAULT));
- GetHostContentSettingsMap()->SetContentSetting(
- ContentSettingsPattern::FromURLNoWildcard(current_url()),
- ContentSettingsPattern::FromURLNoWildcard(current_url()),
- CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string(), CONTENT_SETTING_BLOCK);
+ GetHostContentSettingsMap()->SetContentSettingDefaultScope(
+ current_url(), current_url(), CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(), CONTENT_SETTING_BLOCK);
// Check that the bubble wasn't shown but we get an error for this origin.
WatchPositionAndObservePermissionBubble(false);
@@ -502,10 +501,9 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, NoPromptForDeniedOrigin) {
#endif
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_NoPromptForAllowedOrigin) {
ASSERT_NO_FATAL_FAILURE(Initialize(INITIALIZATION_DEFAULT));
- GetHostContentSettingsMap()->SetContentSetting(
- ContentSettingsPattern::FromURLNoWildcard(current_url()),
- ContentSettingsPattern::FromURLNoWildcard(current_url()),
- CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string(), CONTENT_SETTING_ALLOW);
+ GetHostContentSettingsMap()->SetContentSettingDefaultScope(
+ current_url(), current_url(), CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(), CONTENT_SETTING_ALLOW);
// The bubble is not shown, there is no error, and the position gets to the
// script.
WatchPositionAndObservePermissionBubble(false);
@@ -746,12 +744,9 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_LastUsageUpdated) {
clock_->SetNow(base::Time::UnixEpoch() + base::TimeDelta::FromSeconds(10));
// Setting the permission should trigger the last usage.
- GetHostContentSettingsMap()->SetContentSetting(
- ContentSettingsPattern::FromURLNoWildcard(current_url()),
- ContentSettingsPattern::FromURLNoWildcard(current_url()),
- CONTENT_SETTINGS_TYPE_GEOLOCATION,
- std::string(),
- CONTENT_SETTING_ALLOW);
+ GetHostContentSettingsMap()->SetContentSettingDefaultScope(
+ current_url(), current_url(), CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(), CONTENT_SETTING_ALLOW);
// Permission has been used at the starting time.
EXPECT_EQ(GetHostContentSettingsMap()->GetLastUsage(

Powered by Google App Engine
This is Rietveld 408576698