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

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

Issue 933273002: Revert of Expose camera settings to the 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, 114 EXPECT_EQ(CONTENT_SETTING_ASK,
115 map->GetContentSetting(example_url, 115 map->GetContentSetting(example_url,
116 example_url, 116 example_url,
117 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, 117 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
118 std::string())); 118 std::string()));
119 EXPECT_EQ(CONTENT_SETTING_ASK,
120 map->GetContentSetting(example_url,
121 example_url,
122 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
123 std::string()));
124 119
125 // Check content settings for www.google.com 120 // Check content settings for www.google.com
126 GURL url("http://www.google.com"); 121 GURL url("http://www.google.com");
127 EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed(url, url)); 122 EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed(url, url));
128 EXPECT_EQ(CONTENT_SETTING_ALLOW, 123 EXPECT_EQ(CONTENT_SETTING_ALLOW,
129 map->GetContentSetting( 124 map->GetContentSetting(
130 url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); 125 url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
131 EXPECT_EQ(CONTENT_SETTING_BLOCK, 126 EXPECT_EQ(CONTENT_SETTING_BLOCK,
132 map->GetContentSetting( 127 map->GetContentSetting(
133 url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); 128 url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
134 EXPECT_EQ(CONTENT_SETTING_BLOCK, 129 EXPECT_EQ(CONTENT_SETTING_BLOCK,
135 map->GetContentSetting( 130 map->GetContentSetting(
136 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string())); 131 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string()));
137 EXPECT_EQ(CONTENT_SETTING_ALLOW, 132 EXPECT_EQ(CONTENT_SETTING_ALLOW,
138 map->GetContentSetting( 133 map->GetContentSetting(
139 url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string())); 134 url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string()));
140 EXPECT_EQ(CONTENT_SETTING_BLOCK, 135 EXPECT_EQ(CONTENT_SETTING_BLOCK,
141 map->GetContentSetting( 136 map->GetContentSetting(
142 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string())); 137 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()));
143 EXPECT_EQ( 138 EXPECT_EQ(
144 CONTENT_SETTING_BLOCK, 139 CONTENT_SETTING_BLOCK,
145 map->GetContentSetting( 140 map->GetContentSetting(
146 url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string())); 141 url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string()));
147 EXPECT_EQ(CONTENT_SETTING_BLOCK, 142 EXPECT_EQ(CONTENT_SETTING_BLOCK,
148 map->GetContentSetting( 143 map->GetContentSetting(
149 url, url, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string())); 144 url, url, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()));
150 EXPECT_EQ(CONTENT_SETTING_BLOCK, 145 EXPECT_EQ(CONTENT_SETTING_BLOCK,
151 map->GetContentSetting( 146 map->GetContentSetting(
152 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string())); 147 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string()));
153 EXPECT_EQ(CONTENT_SETTING_BLOCK,
154 map->GetContentSetting(
155 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string()));
156 } 148 }
157 149
158 void CheckContentSettingsDefault() { 150 void CheckContentSettingsDefault() {
159 HostContentSettingsMap* map = 151 HostContentSettingsMap* map =
160 profile_->GetHostContentSettingsMap(); 152 profile_->GetHostContentSettingsMap();
161 CookieSettings* cookie_settings = 153 CookieSettings* cookie_settings =
162 CookieSettings::Factory::GetForProfile(profile_).get(); 154 CookieSettings::Factory::GetForProfile(profile_).get();
163 155
164 // Check content settings for www.google.com 156 // Check content settings for www.google.com
165 GURL url("http://www.google.com"); 157 GURL url("http://www.google.com");
(...skipping 18 matching lines...) Expand all
184 EXPECT_EQ( 176 EXPECT_EQ(
185 CONTENT_SETTING_ASK, 177 CONTENT_SETTING_ASK,
186 map->GetContentSetting( 178 map->GetContentSetting(
187 url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string())); 179 url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string()));
188 EXPECT_EQ(CONTENT_SETTING_ASK, 180 EXPECT_EQ(CONTENT_SETTING_ASK,
189 map->GetContentSetting( 181 map->GetContentSetting(
190 url, url, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string())); 182 url, url, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()));
191 EXPECT_EQ(CONTENT_SETTING_ASK, 183 EXPECT_EQ(CONTENT_SETTING_ASK,
192 map->GetContentSetting( 184 map->GetContentSetting(
193 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string())); 185 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string()));
194 EXPECT_EQ(CONTENT_SETTING_ASK,
195 map->GetContentSetting(
196 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string()));
197 } 186 }
198 187
199 private: 188 private:
200 Profile* profile_; 189 Profile* profile_;
201 }; 190 };
202 191
203 // http://crbug.com/177163 192 // http://crbug.com/177163
204 #if defined(OS_WIN) && !defined(NDEBUG) 193 #if defined(OS_WIN) && !defined(NDEBUG)
205 #define MAYBE_Standard DISABLED_Standard 194 #define MAYBE_Standard DISABLED_Standard
206 #else 195 #else
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 base::FilePath(kBarPath), 240 base::FilePath(kBarPath),
252 base::ASCIIToUTF16("2.3.4"), 241 base::ASCIIToUTF16("2.3.4"),
253 base::ASCIIToUTF16("bar")), 242 base::ASCIIToUTF16("bar")),
254 false); 243 false);
255 244
256 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers")) 245 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers"))
257 << message_; 246 << message_;
258 } 247 }
259 248
260 } // namespace extensions 249 } // 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