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

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

Issue 869073006: Expose unsandboxed plugins (PPAPI) 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
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 EXPECT_EQ(CONTENT_SETTING_ASK, 119 EXPECT_EQ(CONTENT_SETTING_ASK,
120 map->GetContentSetting(example_url, 120 map->GetContentSetting(example_url,
121 example_url, 121 example_url,
122 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, 122 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
123 std::string())); 123 std::string()));
124 EXPECT_EQ(CONTENT_SETTING_ASK, 124 EXPECT_EQ(CONTENT_SETTING_ASK,
125 map->GetContentSetting(example_url, 125 map->GetContentSetting(example_url,
126 example_url, 126 example_url,
127 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, 127 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
128 std::string())); 128 std::string()));
129 EXPECT_EQ(CONTENT_SETTING_ASK,
130 map->GetContentSetting(example_url,
131 example_url,
132 CONTENT_SETTINGS_TYPE_PPAPI_BROKER,
133 std::string()));
129 134
130 // Check content settings for www.google.com 135 // Check content settings for www.google.com
131 GURL url("http://www.google.com"); 136 GURL url("http://www.google.com");
132 EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed(url, url)); 137 EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed(url, url));
133 EXPECT_EQ(CONTENT_SETTING_ALLOW, 138 EXPECT_EQ(CONTENT_SETTING_ALLOW,
134 map->GetContentSetting( 139 map->GetContentSetting(
135 url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); 140 url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
136 EXPECT_EQ(CONTENT_SETTING_BLOCK, 141 EXPECT_EQ(CONTENT_SETTING_BLOCK,
137 map->GetContentSetting( 142 map->GetContentSetting(
138 url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); 143 url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
(...skipping 15 matching lines...) Expand all
154 url, url, CONTENT_SETTINGS_TYPE_FULLSCREEN, std::string())); 159 url, url, CONTENT_SETTINGS_TYPE_FULLSCREEN, std::string()));
155 EXPECT_EQ(CONTENT_SETTING_BLOCK, 160 EXPECT_EQ(CONTENT_SETTING_BLOCK,
156 map->GetContentSetting( 161 map->GetContentSetting(
157 url, url, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string())); 162 url, url, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()));
158 EXPECT_EQ(CONTENT_SETTING_BLOCK, 163 EXPECT_EQ(CONTENT_SETTING_BLOCK,
159 map->GetContentSetting( 164 map->GetContentSetting(
160 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string())); 165 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string()));
161 EXPECT_EQ(CONTENT_SETTING_BLOCK, 166 EXPECT_EQ(CONTENT_SETTING_BLOCK,
162 map->GetContentSetting( 167 map->GetContentSetting(
163 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string())); 168 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string()));
169 EXPECT_EQ(CONTENT_SETTING_BLOCK,
170 map->GetContentSetting(
171 url, url, CONTENT_SETTINGS_TYPE_PPAPI_BROKER, std::string()));
164 } 172 }
165 173
166 void CheckContentSettingsDefault() { 174 void CheckContentSettingsDefault() {
167 HostContentSettingsMap* map = 175 HostContentSettingsMap* map =
168 profile_->GetHostContentSettingsMap(); 176 profile_->GetHostContentSettingsMap();
169 CookieSettings* cookie_settings = 177 CookieSettings* cookie_settings =
170 CookieSettings::Factory::GetForProfile(profile_).get(); 178 CookieSettings::Factory::GetForProfile(profile_).get();
171 179
172 // Check content settings for www.google.com 180 // Check content settings for www.google.com
173 GURL url("http://www.google.com"); 181 GURL url("http://www.google.com");
(...skipping 24 matching lines...) Expand all
198 url, url, CONTENT_SETTINGS_TYPE_FULLSCREEN, std::string())); 206 url, url, CONTENT_SETTINGS_TYPE_FULLSCREEN, std::string()));
199 EXPECT_EQ(CONTENT_SETTING_ASK, 207 EXPECT_EQ(CONTENT_SETTING_ASK,
200 map->GetContentSetting( 208 map->GetContentSetting(
201 url, url, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string())); 209 url, url, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()));
202 EXPECT_EQ(CONTENT_SETTING_ASK, 210 EXPECT_EQ(CONTENT_SETTING_ASK,
203 map->GetContentSetting( 211 map->GetContentSetting(
204 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string())); 212 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string()));
205 EXPECT_EQ(CONTENT_SETTING_ASK, 213 EXPECT_EQ(CONTENT_SETTING_ASK,
206 map->GetContentSetting( 214 map->GetContentSetting(
207 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string())); 215 url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string()));
216 EXPECT_EQ(CONTENT_SETTING_ASK,
217 map->GetContentSetting(
218 url, url, CONTENT_SETTINGS_TYPE_PPAPI_BROKER, std::string()));
208 } 219 }
209 220
210 private: 221 private:
211 Profile* profile_; 222 Profile* profile_;
212 }; 223 };
213 224
214 // http://crbug.com/177163 225 // http://crbug.com/177163
215 #if defined(OS_WIN) && !defined(NDEBUG) 226 #if defined(OS_WIN) && !defined(NDEBUG)
216 #define MAYBE_Standard DISABLED_Standard 227 #define MAYBE_Standard DISABLED_Standard
217 #else 228 #else
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 base::FilePath(kBarPath), 273 base::FilePath(kBarPath),
263 base::ASCIIToUTF16("2.3.4"), 274 base::ASCIIToUTF16("2.3.4"),
264 base::ASCIIToUTF16("bar")), 275 base::ASCIIToUTF16("bar")),
265 false); 276 false);
266 277
267 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers")) 278 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers"))
268 << message_; 279 << message_;
269 } 280 }
270 281
271 } // namespace extensions 282 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698