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

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

Issue 1417173010: Adding <keygen> Content Setting (core) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing keygen_rules. Created 5 years, 1 month 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/location.h" 5 #include "base/location.h"
6 #include "base/prefs/pref_service.h" 6 #include "base/prefs/pref_service.h"
7 #include "base/single_thread_task_runner.h" 7 #include "base/single_thread_task_runner.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 EXPECT_EQ(CONTENT_SETTING_ALLOW, 85 EXPECT_EQ(CONTENT_SETTING_ALLOW,
86 map->GetContentSetting(example_url, 86 map->GetContentSetting(example_url,
87 example_url, 87 example_url,
88 CONTENT_SETTINGS_TYPE_IMAGES, 88 CONTENT_SETTINGS_TYPE_IMAGES,
89 std::string())); 89 std::string()));
90 EXPECT_EQ(CONTENT_SETTING_BLOCK, 90 EXPECT_EQ(CONTENT_SETTING_BLOCK,
91 map->GetContentSetting(example_url, 91 map->GetContentSetting(example_url,
92 example_url, 92 example_url,
93 CONTENT_SETTINGS_TYPE_JAVASCRIPT, 93 CONTENT_SETTINGS_TYPE_JAVASCRIPT,
94 std::string())); 94 std::string()));
95 EXPECT_EQ(
msramek 2015/11/05 17:07:09 It doesn't make much sense to test the effect of e
svaldez 2015/11/05 17:37:51 Done.
96 CONTENT_SETTING_BLOCK,
97 map->GetContentSetting(example_url, example_url,
98 CONTENT_SETTINGS_TYPE_KEYGEN, std::string()));
95 EXPECT_EQ(CONTENT_SETTING_ALLOW, 99 EXPECT_EQ(CONTENT_SETTING_ALLOW,
96 map->GetContentSetting(example_url, 100 map->GetContentSetting(example_url,
97 example_url, 101 example_url,
98 CONTENT_SETTINGS_TYPE_PLUGINS, 102 CONTENT_SETTINGS_TYPE_PLUGINS,
99 std::string())); 103 std::string()));
100 EXPECT_EQ(CONTENT_SETTING_BLOCK, 104 EXPECT_EQ(CONTENT_SETTING_BLOCK,
101 map->GetContentSetting(example_url, 105 map->GetContentSetting(example_url,
102 example_url, 106 example_url,
103 CONTENT_SETTINGS_TYPE_POPUPS, 107 CONTENT_SETTINGS_TYPE_POPUPS,
104 std::string())); 108 std::string()));
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 149
146 // Check content settings for www.google.com 150 // Check content settings for www.google.com
147 GURL url("http://www.google.com"); 151 GURL url("http://www.google.com");
148 EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed(url, url)); 152 EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed(url, url));
149 EXPECT_EQ(CONTENT_SETTING_ALLOW, 153 EXPECT_EQ(CONTENT_SETTING_ALLOW,
150 map->GetContentSetting( 154 map->GetContentSetting(
151 url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); 155 url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
152 EXPECT_EQ(CONTENT_SETTING_BLOCK, 156 EXPECT_EQ(CONTENT_SETTING_BLOCK,
153 map->GetContentSetting( 157 map->GetContentSetting(
154 url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); 158 url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
159 EXPECT_EQ(CONTENT_SETTING_BLOCK,
160 map->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_KEYGEN,
161 std::string()));
155 EXPECT_EQ(CONTENT_SETTING_DETECT_IMPORTANT_CONTENT, 162 EXPECT_EQ(CONTENT_SETTING_DETECT_IMPORTANT_CONTENT,
156 map->GetContentSetting( 163 map->GetContentSetting(
157 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string())); 164 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string()));
158 EXPECT_EQ(CONTENT_SETTING_ALLOW, 165 EXPECT_EQ(CONTENT_SETTING_ALLOW,
159 map->GetContentSetting( 166 map->GetContentSetting(
160 url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string())); 167 url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string()));
161 EXPECT_EQ(CONTENT_SETTING_BLOCK, 168 EXPECT_EQ(CONTENT_SETTING_BLOCK,
162 map->GetContentSetting( 169 map->GetContentSetting(
163 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string())); 170 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()));
164 EXPECT_EQ( 171 EXPECT_EQ(
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 GURL url("http://www.google.com"); 203 GURL url("http://www.google.com");
197 EXPECT_TRUE(cookie_settings->IsReadingCookieAllowed(url, url)); 204 EXPECT_TRUE(cookie_settings->IsReadingCookieAllowed(url, url));
198 EXPECT_TRUE(cookie_settings->IsSettingCookieAllowed(url, url)); 205 EXPECT_TRUE(cookie_settings->IsSettingCookieAllowed(url, url));
199 EXPECT_FALSE(cookie_settings->IsCookieSessionOnly(url)); 206 EXPECT_FALSE(cookie_settings->IsCookieSessionOnly(url));
200 EXPECT_EQ(CONTENT_SETTING_ALLOW, 207 EXPECT_EQ(CONTENT_SETTING_ALLOW,
201 map->GetContentSetting( 208 map->GetContentSetting(
202 url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); 209 url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
203 EXPECT_EQ(CONTENT_SETTING_ALLOW, 210 EXPECT_EQ(CONTENT_SETTING_ALLOW,
204 map->GetContentSetting( 211 map->GetContentSetting(
205 url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); 212 url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
213 EXPECT_EQ(CONTENT_SETTING_BLOCK,
214 map->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_KEYGEN,
215 std::string()));
206 EXPECT_EQ(CONTENT_SETTING_DETECT_IMPORTANT_CONTENT, 216 EXPECT_EQ(CONTENT_SETTING_DETECT_IMPORTANT_CONTENT,
207 map->GetContentSetting( 217 map->GetContentSetting(
208 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string())); 218 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string()));
209 EXPECT_EQ(CONTENT_SETTING_BLOCK, 219 EXPECT_EQ(CONTENT_SETTING_BLOCK,
210 map->GetContentSetting( 220 map->GetContentSetting(
211 url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string())); 221 url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string()));
212 EXPECT_EQ(CONTENT_SETTING_ASK, 222 EXPECT_EQ(CONTENT_SETTING_ASK,
213 map->GetContentSetting( 223 map->GetContentSetting(
214 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string())); 224 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()));
215 EXPECT_EQ( 225 EXPECT_EQ(
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 << message_; 308 << message_;
299 } 309 }
300 310
301 IN_PROC_BROWSER_TEST_F(ExtensionContentSettingsApiTest, 311 IN_PROC_BROWSER_TEST_F(ExtensionContentSettingsApiTest,
302 UnsupportedDefaultSettings) { 312 UnsupportedDefaultSettings) {
303 const char kExtensionPath[] = "content_settings/unsupporteddefaultsettings"; 313 const char kExtensionPath[] = "content_settings/unsupporteddefaultsettings";
304 EXPECT_TRUE(RunExtensionSubtest(kExtensionPath, "test.html")) << message_; 314 EXPECT_TRUE(RunExtensionSubtest(kExtensionPath, "test.html")) << message_;
305 } 315 }
306 316
307 } // namespace extensions 317 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698