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

Side by Side Diff: chrome/browser/extensions/api/content_settings/content_settings_apitest.cc

Issue 925303003: Revert of Expose microphone content setting to extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/content_settings/content_settings_helpers.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/prefs/pref_service.h" 5 #include "base/prefs/pref_service.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/content_settings/cookie_settings.h" 9 #include "chrome/browser/content_settings/cookie_settings.h"
10 #include "chrome/browser/extensions/api/content_settings/content_settings_api.h" 10 #include "chrome/browser/extensions/api/content_settings/content_settings_api.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 EXPECT_EQ(CONTENT_SETTING_ASK, 104 EXPECT_EQ(CONTENT_SETTING_ASK,
105 map->GetContentSetting(example_url, 105 map->GetContentSetting(example_url,
106 example_url, 106 example_url,
107 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, 107 CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
108 std::string())); 108 std::string()));
109 EXPECT_EQ(CONTENT_SETTING_ASK, 109 EXPECT_EQ(CONTENT_SETTING_ASK,
110 map->GetContentSetting(example_url, 110 map->GetContentSetting(example_url,
111 example_url, 111 example_url,
112 CONTENT_SETTINGS_TYPE_MOUSELOCK, 112 CONTENT_SETTINGS_TYPE_MOUSELOCK,
113 std::string())); 113 std::string()));
114 EXPECT_EQ(CONTENT_SETTING_ASK,
115 map->GetContentSetting(example_url,
116 example_url,
117 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
118 std::string()));
119 114
120 // Check content settings for www.google.com 115 // Check content settings for www.google.com
121 GURL url("http://www.google.com"); 116 GURL url("http://www.google.com");
122 EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed(url, url)); 117 EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed(url, url));
123 EXPECT_EQ(CONTENT_SETTING_ALLOW, 118 EXPECT_EQ(CONTENT_SETTING_ALLOW,
124 map->GetContentSetting( 119 map->GetContentSetting(
125 url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); 120 url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
126 EXPECT_EQ(CONTENT_SETTING_BLOCK, 121 EXPECT_EQ(CONTENT_SETTING_BLOCK,
127 map->GetContentSetting( 122 map->GetContentSetting(
128 url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); 123 url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
129 EXPECT_EQ(CONTENT_SETTING_BLOCK, 124 EXPECT_EQ(CONTENT_SETTING_BLOCK,
130 map->GetContentSetting( 125 map->GetContentSetting(
131 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string())); 126 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string()));
132 EXPECT_EQ(CONTENT_SETTING_ALLOW, 127 EXPECT_EQ(CONTENT_SETTING_ALLOW,
133 map->GetContentSetting( 128 map->GetContentSetting(
134 url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string())); 129 url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string()));
135 EXPECT_EQ(CONTENT_SETTING_BLOCK, 130 EXPECT_EQ(CONTENT_SETTING_BLOCK,
136 map->GetContentSetting( 131 map->GetContentSetting(
137 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string())); 132 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()));
138 EXPECT_EQ( 133 EXPECT_EQ(
139 CONTENT_SETTING_BLOCK, 134 CONTENT_SETTING_BLOCK,
140 map->GetContentSetting( 135 map->GetContentSetting(
141 url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string())); 136 url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string()));
142 EXPECT_EQ(CONTENT_SETTING_BLOCK, 137 EXPECT_EQ(CONTENT_SETTING_BLOCK,
143 map->GetContentSetting( 138 map->GetContentSetting(
144 url, url, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string())); 139 url, url, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()));
145 EXPECT_EQ(CONTENT_SETTING_BLOCK,
146 map->GetContentSetting(
147 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string()));
148 } 140 }
149 141
150 void CheckContentSettingsDefault() { 142 void CheckContentSettingsDefault() {
151 HostContentSettingsMap* map = 143 HostContentSettingsMap* map =
152 profile_->GetHostContentSettingsMap(); 144 profile_->GetHostContentSettingsMap();
153 CookieSettings* cookie_settings = 145 CookieSettings* cookie_settings =
154 CookieSettings::Factory::GetForProfile(profile_).get(); 146 CookieSettings::Factory::GetForProfile(profile_).get();
155 147
156 // Check content settings for www.google.com 148 // Check content settings for www.google.com
157 GURL url("http://www.google.com"); 149 GURL url("http://www.google.com");
(...skipping 15 matching lines...) Expand all
173 EXPECT_EQ(CONTENT_SETTING_ASK, 165 EXPECT_EQ(CONTENT_SETTING_ASK,
174 map->GetContentSetting( 166 map->GetContentSetting(
175 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string())); 167 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()));
176 EXPECT_EQ( 168 EXPECT_EQ(
177 CONTENT_SETTING_ASK, 169 CONTENT_SETTING_ASK,
178 map->GetContentSetting( 170 map->GetContentSetting(
179 url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string())); 171 url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string()));
180 EXPECT_EQ(CONTENT_SETTING_ASK, 172 EXPECT_EQ(CONTENT_SETTING_ASK,
181 map->GetContentSetting( 173 map->GetContentSetting(
182 url, url, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string())); 174 url, url, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()));
183 EXPECT_EQ(CONTENT_SETTING_ASK,
184 map->GetContentSetting(
185 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string()));
186 } 175 }
187 176
188 private: 177 private:
189 Profile* profile_; 178 Profile* profile_;
190 }; 179 };
191 180
192 // http://crbug.com/177163 181 // http://crbug.com/177163
193 #if defined(OS_WIN) && !defined(NDEBUG) 182 #if defined(OS_WIN) && !defined(NDEBUG)
194 #define MAYBE_Standard DISABLED_Standard 183 #define MAYBE_Standard DISABLED_Standard
195 #else 184 #else
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 base::FilePath(kBarPath), 229 base::FilePath(kBarPath),
241 base::ASCIIToUTF16("2.3.4"), 230 base::ASCIIToUTF16("2.3.4"),
242 base::ASCIIToUTF16("bar")), 231 base::ASCIIToUTF16("bar")),
243 false); 232 false);
244 233
245 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers")) 234 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers"))
246 << message_; 235 << message_;
247 } 236 }
248 237
249 } // namespace extensions 238 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/content_settings/content_settings_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698