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

Unified Diff: chrome/browser/geolocation/geolocation_settings_state_unittest.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: remove CustomScope due to depending CL update 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_settings_state_unittest.cc
diff --git a/chrome/browser/geolocation/geolocation_settings_state_unittest.cc b/chrome/browser/geolocation/geolocation_settings_state_unittest.cc
index 1c9197eebffab6bbed3e9f15f1f1aa13672702f8..947b46faa05d2917e579fdc6d819656a12223a1e 100644
--- a/chrome/browser/geolocation/geolocation_settings_state_unittest.cc
+++ b/chrome/browser/geolocation/geolocation_settings_state_unittest.cc
@@ -41,21 +41,17 @@ TEST_F(GeolocationSettingsStateTests, ClearOnNewOrigin) {
load_committed_details.entry = entry.get();
state.DidNavigate(load_committed_details);
- HostContentSettingsMapFactory::GetForProfile(profile)->SetContentSetting(
- ContentSettingsPattern::FromURLNoWildcard(url_0),
- ContentSettingsPattern::FromURLNoWildcard(url_0),
- CONTENT_SETTINGS_TYPE_GEOLOCATION,
- std::string(),
- CONTENT_SETTING_ALLOW);
+ HostContentSettingsMapFactory::GetForProfile(profile)
+ ->SetContentSettingDefaultScope(url_0, url_0,
+ CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(), CONTENT_SETTING_ALLOW);
state.OnGeolocationPermissionSet(url_0, true);
GURL url_1("http://www.example1.com");
- HostContentSettingsMapFactory::GetForProfile(profile)->SetContentSetting(
- ContentSettingsPattern::FromURLNoWildcard(url_1),
- ContentSettingsPattern::FromURLNoWildcard(url_0),
- CONTENT_SETTINGS_TYPE_GEOLOCATION,
- std::string(),
- CONTENT_SETTING_BLOCK);
+ HostContentSettingsMapFactory::GetForProfile(profile)
+ ->SetContentSettingDefaultScope(url_1, url_0,
+ CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(), CONTENT_SETTING_BLOCK);
state.OnGeolocationPermissionSet(url_1, false);
GeolocationSettingsState::StateMap state_map =
@@ -146,30 +142,24 @@ TEST_F(GeolocationSettingsStateTests, ShowPortOnSameHost) {
load_committed_details.entry = entry.get();
state.DidNavigate(load_committed_details);
- HostContentSettingsMapFactory::GetForProfile(profile)->SetContentSetting(
- ContentSettingsPattern::FromURLNoWildcard(url_0),
- ContentSettingsPattern::FromURLNoWildcard(url_0),
- CONTENT_SETTINGS_TYPE_GEOLOCATION,
- std::string(),
- CONTENT_SETTING_ALLOW);
+ HostContentSettingsMapFactory::GetForProfile(profile)
+ ->SetContentSettingDefaultScope(url_0, url_0,
+ CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(), CONTENT_SETTING_ALLOW);
state.OnGeolocationPermissionSet(url_0, true);
GURL url_1("https://www.example.com");
- HostContentSettingsMapFactory::GetForProfile(profile)->SetContentSetting(
- ContentSettingsPattern::FromURLNoWildcard(url_1),
- ContentSettingsPattern::FromURLNoWildcard(url_0),
- CONTENT_SETTINGS_TYPE_GEOLOCATION,
- std::string(),
- CONTENT_SETTING_ALLOW);
+ HostContentSettingsMapFactory::GetForProfile(profile)
+ ->SetContentSettingDefaultScope(url_1, url_0,
+ CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(), CONTENT_SETTING_ALLOW);
state.OnGeolocationPermissionSet(url_1, true);
GURL url_2("http://www.example1.com");
- HostContentSettingsMapFactory::GetForProfile(profile)->SetContentSetting(
- ContentSettingsPattern::FromURLNoWildcard(url_2),
- ContentSettingsPattern::FromURLNoWildcard(url_0),
- CONTENT_SETTINGS_TYPE_GEOLOCATION,
- std::string(),
- CONTENT_SETTING_ALLOW);
+ HostContentSettingsMapFactory::GetForProfile(profile)
+ ->SetContentSettingDefaultScope(url_2, url_0,
+ CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(), CONTENT_SETTING_ALLOW);
state.OnGeolocationPermissionSet(url_2, true);
GeolocationSettingsState::StateMap state_map =
« no previous file with comments | « chrome/browser/geolocation/geolocation_browsertest.cc ('k') | chrome/browser/push_messaging/push_messaging_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698