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

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: 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
« no previous file with comments | « no previous file | chrome/browser/geolocation/geolocation_settings_state_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/geolocation/geolocation_browsertest.cc
diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc
index 8be381a81bd6ee6fff2a2c0df1f4815e5df8454c..b3ec17225dc101e6d2ffa21482d05b0cb4ebec48 100644
--- a/chrome/browser/geolocation/geolocation_browsertest.cc
+++ b/chrome/browser/geolocation/geolocation_browsertest.cc
@@ -26,7 +26,6 @@
#include "chrome/test/base/ui_test_utils.h"
#include "components/content_settings/core/browser/content_settings_usages_state.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
-#include "components/content_settings/core/common/content_settings_pattern.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
@@ -478,10 +477,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);
@@ -501,10 +499,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);
@@ -745,12 +742,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(
« no previous file with comments | « no previous file | chrome/browser/geolocation/geolocation_settings_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698