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

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

Issue 7484072: Migrate geolocation settings to host content settings map. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 5 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 238d21cfcf7eee2a2ba7def88d3ba4a313193df6..38feb7b3e0d8e5accb488a4a77c26ed60bde1a12 100644
--- a/chrome/browser/geolocation/geolocation_settings_state_unittest.cc
+++ b/chrome/browser/geolocation/geolocation_settings_state_unittest.cc
@@ -1,8 +1,10 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/geolocation/geolocation_content_settings_map.h"
+#include <string>
+
+#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/geolocation/geolocation_settings_state.h"
#include "chrome/test/base/testing_profile.h"
#include "content/browser/browser_thread.h"
@@ -14,7 +16,7 @@ namespace {
class GeolocationSettingsStateTests : public testing::Test {
public:
- GeolocationSettingsStateTests()
+ GeolocationSettingsStateTests()
: ui_thread_(BrowserThread::UI, &message_loop_) {
}
@@ -34,13 +36,21 @@ TEST_F(GeolocationSettingsStateTests, ClearOnNewOrigin) {
load_committed_details.entry = &entry;
state.DidNavigate(load_committed_details);
- profile.GetGeolocationContentSettingsMap()->SetContentSetting(
- url_0, url_0, CONTENT_SETTING_ALLOW);
+ profile.GetHostContentSettingsMap()->SetContentSetting(
+ ContentSettingsPattern::FromURLNoWildcard(url_0),
+ ContentSettingsPattern::FromURLNoWildcard(url_0),
+ CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(),
+ CONTENT_SETTING_ALLOW);
state.OnGeolocationPermissionSet(url_0, true);
GURL url_1("http://www.example1.com");
- profile.GetGeolocationContentSettingsMap()->SetContentSetting(
- url_1, url_0, CONTENT_SETTING_BLOCK);
+ profile.GetHostContentSettingsMap()->SetContentSetting(
+ ContentSettingsPattern::FromURLNoWildcard(url_1),
+ ContentSettingsPattern::FromURLNoWildcard(url_0),
+ CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(),
+ CONTENT_SETTING_BLOCK);
state.OnGeolocationPermissionSet(url_1, false);
GeolocationSettingsState::StateMap state_map =
@@ -131,18 +141,30 @@ TEST_F(GeolocationSettingsStateTests, ShowPortOnSameHost) {
load_committed_details.entry = &entry;
state.DidNavigate(load_committed_details);
- profile.GetGeolocationContentSettingsMap()->SetContentSetting(
- url_0, url_0, CONTENT_SETTING_ALLOW);
+ profile.GetHostContentSettingsMap()->SetContentSetting(
+ ContentSettingsPattern::FromURLNoWildcard(url_0),
+ ContentSettingsPattern::FromURLNoWildcard(url_0),
+ CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(),
+ CONTENT_SETTING_ALLOW);
state.OnGeolocationPermissionSet(url_0, true);
GURL url_1("https://www.example.com");
- profile.GetGeolocationContentSettingsMap()->SetContentSetting(
- url_1, url_0, CONTENT_SETTING_ALLOW);
+ profile.GetHostContentSettingsMap()->SetContentSetting(
+ ContentSettingsPattern::FromURLNoWildcard(url_1),
+ ContentSettingsPattern::FromURLNoWildcard(url_0),
+ CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(),
+ CONTENT_SETTING_ALLOW);
state.OnGeolocationPermissionSet(url_1, true);
GURL url_2("http://www.example1.com");
- profile.GetGeolocationContentSettingsMap()->SetContentSetting(
- url_2, url_0, CONTENT_SETTING_ALLOW);
+ profile.GetHostContentSettingsMap()->SetContentSetting(
+ ContentSettingsPattern::FromURLNoWildcard(url_2),
+ ContentSettingsPattern::FromURLNoWildcard(url_0),
+ CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(),
+ CONTENT_SETTING_ALLOW);
state.OnGeolocationPermissionSet(url_2, true);
GeolocationSettingsState::StateMap state_map =

Powered by Google App Engine
This is Rietveld 408576698