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

Side by Side Diff: chrome/browser/permissions/permission_context_base_unittest.cc

Issue 2184823007: Add a feature which, when enabled, blocks permissions after X prompt dismissals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing nits Created 4 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/permissions/permission_context_base.h" 5 #include "chrome/browser/permissions/permission_context_base.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/feature_list.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/metrics/field_trial.h" 13 #include "base/metrics/field_trial.h"
14 #include "base/test/histogram_tester.h"
13 #include "base/test/mock_entropy_provider.h" 15 #include "base/test/mock_entropy_provider.h"
14 #include "build/build_config.h" 16 #include "build/build_config.h"
15 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 17 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
16 #include "chrome/browser/infobars/infobar_service.h" 18 #include "chrome/browser/infobars/infobar_service.h"
19 #include "chrome/browser/permissions/permission_decision_auto_blocker.h"
17 #include "chrome/browser/permissions/permission_queue_controller.h" 20 #include "chrome/browser/permissions/permission_queue_controller.h"
18 #include "chrome/browser/permissions/permission_request_id.h" 21 #include "chrome/browser/permissions/permission_request_id.h"
19 #include "chrome/browser/permissions/permission_util.h" 22 #include "chrome/browser/permissions/permission_util.h"
23 #include "chrome/common/chrome_features.h"
20 #include "chrome/common/chrome_switches.h" 24 #include "chrome/common/chrome_switches.h"
21 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 25 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
22 #include "chrome/test/base/testing_profile.h" 26 #include "chrome/test/base/testing_profile.h"
23 #include "components/content_settings/core/browser/host_content_settings_map.h" 27 #include "components/content_settings/core/browser/host_content_settings_map.h"
24 #include "components/content_settings/core/common/content_settings.h" 28 #include "components/content_settings/core/common/content_settings.h"
25 #include "components/content_settings/core/common/content_settings_types.h" 29 #include "components/content_settings/core/common/content_settings_types.h"
26 #include "components/variations/variations_associated_data.h" 30 #include "components/variations/variations_associated_data.h"
27 #include "content/public/browser/permission_type.h" 31 #include "content/public/browser/permission_type.h"
28 #include "content/public/browser/render_frame_host.h" 32 #include "content/public/browser/render_frame_host.h"
29 #include "content/public/browser/web_contents.h" 33 #include "content/public/browser/web_contents.h"
30 #include "content/public/test/mock_render_process_host.h" 34 #include "content/public/test/mock_render_process_host.h"
31 #include "testing/gtest/include/gtest/gtest.h" 35 #include "testing/gtest/include/gtest/gtest.h"
32 36
33 #if defined(OS_ANDROID) 37 #if defined(OS_ANDROID)
34 #include "chrome/browser/permissions/permission_queue_controller.h" 38 #include "chrome/browser/permissions/permission_queue_controller.h"
35 #else 39 #else
36 #include "chrome/browser/permissions/permission_request_manager.h" 40 #include "chrome/browser/permissions/permission_request_manager.h"
37 #endif 41 #endif
38 42
39 const char* kPermissionsKillSwitchFieldStudy = 43 const char* kPermissionsKillSwitchFieldStudy =
40 PermissionContextBase::kPermissionsKillSwitchFieldStudy; 44 PermissionContextBase::kPermissionsKillSwitchFieldStudy;
41 const char* kPermissionsKillSwitchBlockedValue = 45 const char* kPermissionsKillSwitchBlockedValue =
42 PermissionContextBase::kPermissionsKillSwitchBlockedValue; 46 PermissionContextBase::kPermissionsKillSwitchBlockedValue;
43 const char kPermissionsKillSwitchTestGroup[] = "TestGroup"; 47 const char kPermissionsKillSwitchTestGroup[] = "TestGroup";
48 const char* kPromptGroupName = kPermissionsKillSwitchTestGroup;
49 const char kPromptTrialName[] = "PermissionPromptsUX";
44 50
45 class TestPermissionContext : public PermissionContextBase { 51 class TestPermissionContext : public PermissionContextBase {
46 public: 52 public:
47 TestPermissionContext(Profile* profile, 53 TestPermissionContext(Profile* profile,
48 const content::PermissionType permission_type, 54 const content::PermissionType permission_type,
49 const ContentSettingsType content_settings_type) 55 const ContentSettingsType content_settings_type)
50 : PermissionContextBase(profile, permission_type, content_settings_type), 56 : PermissionContextBase(profile, permission_type, content_settings_type),
51 tab_context_updated_(false), 57 tab_context_updated_(false) {}
52 field_trial_list_(
53 new base::FieldTrialList(new base::MockEntropyProvider)) {}
54 58
55 ~TestPermissionContext() override {} 59 ~TestPermissionContext() override {}
56 60
57 #if defined(OS_ANDROID) 61 #if defined(OS_ANDROID)
58 PermissionQueueController* GetInfoBarController() { 62 PermissionQueueController* GetInfoBarController() {
59 return GetQueueController(); 63 return GetQueueController();
60 } 64 }
61 #endif 65 #endif
62 66
63 const std::vector<ContentSetting>& decisions() { return decisions_; } 67 const std::vector<ContentSetting>& decisions() { return decisions_; }
64 68
65 bool tab_context_updated() { 69 bool tab_context_updated() {
66 return tab_context_updated_; 70 return tab_context_updated_;
67 } 71 }
68 72
69 void TrackPermissionDecision(ContentSetting content_setting) { 73 void TrackPermissionDecision(ContentSetting content_setting) {
70 decisions_.push_back(content_setting); 74 decisions_.push_back(content_setting);
71 } 75 }
72 76
73 void ResetFieldTrialList() {
74 // Destroy the existing FieldTrialList before creating a new one to avoid
75 // a DCHECK.
76 field_trial_list_.reset();
77 field_trial_list_.reset(new base::FieldTrialList(
78 new base::MockEntropyProvider));
79 variations::testing::ClearAllVariationParams();
80 }
81
82 ContentSetting GetContentSettingFromMap(const GURL& url_a, 77 ContentSetting GetContentSettingFromMap(const GURL& url_a,
83 const GURL& url_b) { 78 const GURL& url_b) {
84 return HostContentSettingsMapFactory::GetForProfile(profile()) 79 return HostContentSettingsMapFactory::GetForProfile(profile())
85 ->GetContentSetting(url_a.GetOrigin(), url_b.GetOrigin(), 80 ->GetContentSetting(url_a.GetOrigin(), url_b.GetOrigin(),
86 content_settings_type(), std::string()); 81 content_settings_type(), std::string());
87 } 82 }
88 83
89 protected: 84 protected:
90 void UpdateTabContext(const PermissionRequestID& id, 85 void UpdateTabContext(const PermissionRequestID& id,
91 const GURL& requesting_origin, 86 const GURL& requesting_origin,
92 bool allowed) override { 87 bool allowed) override {
93 tab_context_updated_ = true; 88 tab_context_updated_ = true;
94 } 89 }
95 90
96 bool IsRestrictedToSecureOrigins() const override { 91 bool IsRestrictedToSecureOrigins() const override {
97 return false; 92 return false;
98 } 93 }
99 94
100 private: 95 private:
101 std::vector<ContentSetting> decisions_; 96 std::vector<ContentSetting> decisions_;
102 bool tab_context_updated_; 97 bool tab_context_updated_;
98 };
99
100 class TestKillSwitchPermissionContext : public TestPermissionContext {
101 public:
102 TestKillSwitchPermissionContext(
103 Profile* profile,
104 const content::PermissionType permission_type,
105 const ContentSettingsType content_settings_type)
106 : TestPermissionContext(profile, permission_type, content_settings_type),
107 field_trial_list_(
108 new base::FieldTrialList(new base::MockEntropyProvider)) {}
109
110 void ResetFieldTrialList() {
111 // Destroy the existing FieldTrialList before creating a new one to avoid
112 // a DCHECK.
113 field_trial_list_.reset();
114 field_trial_list_.reset(new base::FieldTrialList(
115 new base::MockEntropyProvider));
116 variations::testing::ClearAllVariationParams();
117 }
118
119 private:
103 std::unique_ptr<base::FieldTrialList> field_trial_list_; 120 std::unique_ptr<base::FieldTrialList> field_trial_list_;
104 }; 121 };
105 122
106 class PermissionContextBaseTests : public ChromeRenderViewHostTestHarness { 123 class PermissionContextBaseTests : public ChromeRenderViewHostTestHarness {
107 protected: 124 protected:
108 PermissionContextBaseTests() {} 125 PermissionContextBaseTests() {}
109 126
110 // Accept or dismiss the permission bubble or infobar. 127 // Accept or dismiss the permission bubble or infobar.
111 void RespondToPermission(TestPermissionContext* context, 128 void RespondToPermission(TestPermissionContext* context,
112 const PermissionRequestID& id, 129 const PermissionRequestID& id,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 base::Unretained(&permission_context))); 200 base::Unretained(&permission_context)));
184 201
185 RespondToPermission(&permission_context, id, url, CONTENT_SETTING_ASK); 202 RespondToPermission(&permission_context, id, url, CONTENT_SETTING_ASK);
186 EXPECT_EQ(1u, permission_context.decisions().size()); 203 EXPECT_EQ(1u, permission_context.decisions().size());
187 EXPECT_EQ(CONTENT_SETTING_ASK, permission_context.decisions()[0]); 204 EXPECT_EQ(CONTENT_SETTING_ASK, permission_context.decisions()[0]);
188 EXPECT_TRUE(permission_context.tab_context_updated()); 205 EXPECT_TRUE(permission_context.tab_context_updated());
189 EXPECT_EQ(CONTENT_SETTING_ASK, 206 EXPECT_EQ(CONTENT_SETTING_ASK,
190 permission_context.GetContentSettingFromMap(url, url)); 207 permission_context.GetContentSettingFromMap(url, url));
191 } 208 }
192 209
210 void DismissMultipleTimesAndExpectBlock(
211 const GURL& url,
212 content::PermissionType permission_type,
213 ContentSettingsType content_settings_type,
214 uint32_t iterations) {
215 base::HistogramTester histograms;
216
217 // Dismiss |iterations| times. The final dismiss should change the decision
218 // from dismiss to block, and hence change the persisted content setting.
219 for (uint32_t i = 0; i < iterations; ++i) {
220 TestPermissionContext permission_context(
221 profile(), permission_type, content_settings_type);
222 ContentSetting expected =
223 (i < (iterations - 1)) ? CONTENT_SETTING_ASK : CONTENT_SETTING_BLOCK;
224
225 const PermissionRequestID id(
226 web_contents()->GetRenderProcessHost()->GetID(),
227 web_contents()->GetMainFrame()->GetRoutingID(), i);
228 permission_context.RequestPermission(
229 web_contents(), id, url, true /* user_gesture */,
230 base::Bind(&TestPermissionContext::TrackPermissionDecision,
231 base::Unretained(&permission_context)));
232
233 RespondToPermission(&permission_context, id, url, CONTENT_SETTING_ASK);
234 histograms.ExpectTotalCount(
235 "Permissions.Prompt.DismissCount." +
236 PermissionUtil::GetPermissionString(permission_type),
237 i + 1);
238
239 EXPECT_EQ(1u, permission_context.decisions().size());
240 EXPECT_EQ(expected, permission_context.decisions()[0]);
241 EXPECT_TRUE(permission_context.tab_context_updated());
242 EXPECT_EQ(expected,
243 permission_context.GetContentSettingFromMap(url, url));
244 }
245
246 // Ensure that we finish in the block state.
247 TestPermissionContext permission_context(
248 profile(), permission_type, content_settings_type);
249 EXPECT_EQ(CONTENT_SETTING_BLOCK,
250 permission_context.GetContentSettingFromMap(url, url));
251 }
252
253 void TestBlockOnSeveralDismissals_TestContent() {
254 GURL url("https://www.google.com");
255 NavigateAndCommit(url);
256 base::HistogramTester histograms;
257
258 // First, ensure that > 3 dismissals behaves correctly.
259 for (uint32_t i = 0; i < 4; ++i) {
260 TestPermissionContext permission_context(
261 profile(), content::PermissionType::GEOLOCATION,
262 CONTENT_SETTINGS_TYPE_GEOLOCATION);
263
264 const PermissionRequestID id(
265 web_contents()->GetRenderProcessHost()->GetID(),
266 web_contents()->GetMainFrame()->GetRoutingID(), i);
267 permission_context.RequestPermission(
268 web_contents(), id, url, true /* user_gesture */,
269 base::Bind(&TestPermissionContext::TrackPermissionDecision,
270 base::Unretained(&permission_context)));
271
272 RespondToPermission(&permission_context, id, url, CONTENT_SETTING_ASK);
273 histograms.ExpectTotalCount("Permissions.Prompt.DismissCount.Geolocation",
274 i + 1);
275 EXPECT_EQ(1u, permission_context.decisions().size());
276 EXPECT_EQ(CONTENT_SETTING_ASK, permission_context.decisions()[0]);
277 EXPECT_TRUE(permission_context.tab_context_updated());
278 EXPECT_EQ(CONTENT_SETTING_ASK,
279 permission_context.GetContentSettingFromMap(url, url));
280 }
281
282 // Flush the dismissal counts. Enable the block on too many dismissals
283 // feature, which is disabled by default.
284 HostContentSettingsMapFactory::GetForProfile(profile())
285 ->ClearSettingsForOneType(
286 CONTENT_SETTINGS_TYPE_PROMPT_NO_DECISION_COUNT);
287
288 // Set up the custom parameter.
289 base::FieldTrialList field_trials_(nullptr);
290 base::FieldTrial* trial = base::FieldTrialList::CreateFieldTrial(
291 kPromptTrialName, kPromptGroupName);
292 base::FeatureList::ClearInstanceForTesting();
Lei Zhang 2016/09/27 21:57:51 If you read the comments for ClearInstanceForTesti
293 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
294 feature_list->RegisterFieldTrialOverride(
295 features::kBlockPromptsIfDismissedOften.name,
296 base::FeatureList::OVERRIDE_ENABLE_FEATURE, trial);
297 base::FeatureList::SetInstance(std::move(feature_list));
298 EXPECT_EQ(base::FeatureList::GetFieldTrial(
299 features::kBlockPromptsIfDismissedOften),
300 trial);
301
302 EXPECT_TRUE(
303 base::FeatureList::IsEnabled(features::kBlockPromptsIfDismissedOften));
304
305 // Sanity check independence per permission type by checking two of them.
306 DismissMultipleTimesAndExpectBlock(url,
307 content::PermissionType::GEOLOCATION,
308 CONTENT_SETTINGS_TYPE_GEOLOCATION, 3);
309 DismissMultipleTimesAndExpectBlock(url,
310 content::PermissionType::NOTIFICATIONS,
311 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, 3);
312 base::FeatureList::ClearInstanceForTesting();
313 }
314
315 void TestVariationBlockOnSeveralDismissals_TestContent() {
316 GURL url("https://www.google.com");
317 NavigateAndCommit(url);
318
319 // Set up the custom parameter and custom value.
320 base::FieldTrialList field_trials_(nullptr);
321 base::FieldTrial* trial = base::FieldTrialList::CreateFieldTrial(
322 kPromptTrialName, kPromptGroupName);
323 std::map<std::string, std::string> params;
324 params[PermissionDecisionAutoBlocker::kPromptDismissCountKey] = "5";
325 ASSERT_TRUE(variations::AssociateVariationParams(
326 kPromptTrialName, kPromptGroupName, params));
327
328 base::FeatureList::ClearInstanceForTesting();
329 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
330 feature_list->RegisterFieldTrialOverride(
331 features::kBlockPromptsIfDismissedOften.name,
332 base::FeatureList::OVERRIDE_ENABLE_FEATURE, trial);
333 base::FeatureList::SetInstance(std::move(feature_list));
334 EXPECT_EQ(base::FeatureList::GetFieldTrial(
335 features::kBlockPromptsIfDismissedOften),
336 trial);
337
338 std::map<std::string, std::string> actualParams;
339 EXPECT_TRUE(variations::GetVariationParamsByFeature(
340 features::kBlockPromptsIfDismissedOften, &actualParams));
341 EXPECT_EQ(params, actualParams);
342
343 for (uint32_t i = 0; i < 5; ++i) {
344 TestPermissionContext permission_context(
345 profile(), content::PermissionType::MIDI_SYSEX,
346 CONTENT_SETTINGS_TYPE_MIDI_SYSEX);
347
348 ContentSetting expected =
349 (i < 4) ? CONTENT_SETTING_ASK : CONTENT_SETTING_BLOCK;
350 const PermissionRequestID id(
351 web_contents()->GetRenderProcessHost()->GetID(),
352 web_contents()->GetMainFrame()->GetRoutingID(), i);
353 permission_context.RequestPermission(
354 web_contents(), id, url, true /* user_gesture */,
355 base::Bind(&TestPermissionContext::TrackPermissionDecision,
356 base::Unretained(&permission_context)));
357
358 RespondToPermission(&permission_context, id, url, CONTENT_SETTING_ASK);
359 EXPECT_EQ(1u, permission_context.decisions().size());
360 EXPECT_EQ(expected, permission_context.decisions()[0]);
361 EXPECT_TRUE(permission_context.tab_context_updated());
362 EXPECT_EQ(expected,
363 permission_context.GetContentSettingFromMap(url, url));
364 }
365
366 // Ensure that we finish in the block state.
367 TestPermissionContext permission_context(
368 profile(), content::PermissionType::MIDI_SYSEX,
369 CONTENT_SETTINGS_TYPE_MIDI_SYSEX);
370 EXPECT_EQ(CONTENT_SETTING_BLOCK,
371 permission_context.GetContentSettingFromMap(url, url));
372 base::FeatureList::ClearInstanceForTesting();
373 variations::testing::ClearAllVariationParams();
374 }
375
193 void TestRequestPermissionInvalidUrl( 376 void TestRequestPermissionInvalidUrl(
194 content::PermissionType permission_type, 377 content::PermissionType permission_type,
195 ContentSettingsType content_settings_type) { 378 ContentSettingsType content_settings_type) {
196 TestPermissionContext permission_context(profile(), permission_type, 379 TestPermissionContext permission_context(profile(), permission_type,
197 content_settings_type); 380 content_settings_type);
198 GURL url; 381 GURL url;
199 ASSERT_FALSE(url.is_valid()); 382 ASSERT_FALSE(url.is_valid());
200 NavigateAndCommit(url); 383 NavigateAndCommit(url);
201 384
202 const PermissionRequestID id( 385 const PermissionRequestID id(
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 permission_context.GetContentSettingFromMap(url, url); 430 permission_context.GetContentSettingFromMap(url, url);
248 ContentSetting default_setting = 431 ContentSetting default_setting =
249 HostContentSettingsMapFactory::GetForProfile(profile()) 432 HostContentSettingsMapFactory::GetForProfile(profile())
250 ->GetDefaultContentSetting(content_settings_type, nullptr); 433 ->GetDefaultContentSetting(content_settings_type, nullptr);
251 EXPECT_EQ(default_setting, setting_after_reset); 434 EXPECT_EQ(default_setting, setting_after_reset);
252 } 435 }
253 436
254 void TestGlobalPermissionsKillSwitch( 437 void TestGlobalPermissionsKillSwitch(
255 content::PermissionType permission_type, 438 content::PermissionType permission_type,
256 ContentSettingsType content_settings_type) { 439 ContentSettingsType content_settings_type) {
257 TestPermissionContext permission_context(profile(), permission_type, 440 TestKillSwitchPermissionContext permission_context(
258 content_settings_type); 441 profile(), permission_type, content_settings_type);
259 permission_context.ResetFieldTrialList(); 442 permission_context.ResetFieldTrialList();
260 443
261 EXPECT_FALSE(permission_context.IsPermissionKillSwitchOn()); 444 EXPECT_FALSE(permission_context.IsPermissionKillSwitchOn());
262 std::map<std::string, std::string> params; 445 std::map<std::string, std::string> params;
263 params[PermissionUtil::GetPermissionString(permission_type)] = 446 params[PermissionUtil::GetPermissionString(permission_type)] =
264 kPermissionsKillSwitchBlockedValue; 447 kPermissionsKillSwitchBlockedValue;
265 variations::AssociateVariationParams( 448 variations::AssociateVariationParams(
266 kPermissionsKillSwitchFieldStudy, kPermissionsKillSwitchTestGroup, 449 kPermissionsKillSwitchFieldStudy, kPermissionsKillSwitchTestGroup,
267 params); 450 params);
268 base::FieldTrialList::CreateFieldTrial(kPermissionsKillSwitchFieldStudy, 451 base::FieldTrialList::CreateFieldTrial(kPermissionsKillSwitchFieldStudy,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 TEST_F(PermissionContextBaseTests, TestAskAndGrant) { 509 TEST_F(PermissionContextBaseTests, TestAskAndGrant) {
327 TestAskAndGrant_TestContent(); 510 TestAskAndGrant_TestContent();
328 } 511 }
329 512
330 // Simulates clicking Dismiss (X) in the infobar/bubble. 513 // Simulates clicking Dismiss (X) in the infobar/bubble.
331 // The permission should be denied but not saved for future use. 514 // The permission should be denied but not saved for future use.
332 TEST_F(PermissionContextBaseTests, TestAskAndDismiss) { 515 TEST_F(PermissionContextBaseTests, TestAskAndDismiss) {
333 TestAskAndDismiss_TestContent(); 516 TestAskAndDismiss_TestContent();
334 } 517 }
335 518
519 // Simulates clicking Dismiss (X) in the infobar/bubble with the block on too
520 // many dismissals feature active. The permission should be blocked after
521 // several dismissals.
522 TEST_F(PermissionContextBaseTests, TestDismissUntilBlocked) {
523 TestBlockOnSeveralDismissals_TestContent();
524 }
525
526 // Test setting a custom number of dismissals before block via variations.
527 TEST_F(PermissionContextBaseTests, TestDismissVariations) {
528 TestVariationBlockOnSeveralDismissals_TestContent();
529 }
530
336 // Simulates non-valid requesting URL. 531 // Simulates non-valid requesting URL.
337 // The permission should be denied but not saved for future use. 532 // The permission should be denied but not saved for future use.
338 TEST_F(PermissionContextBaseTests, TestNonValidRequestingUrl) { 533 TEST_F(PermissionContextBaseTests, TestNonValidRequestingUrl) {
339 TestRequestPermissionInvalidUrl(content::PermissionType::GEOLOCATION, 534 TestRequestPermissionInvalidUrl(content::PermissionType::GEOLOCATION,
340 CONTENT_SETTINGS_TYPE_GEOLOCATION); 535 CONTENT_SETTINGS_TYPE_GEOLOCATION);
341 TestRequestPermissionInvalidUrl(content::PermissionType::NOTIFICATIONS, 536 TestRequestPermissionInvalidUrl(content::PermissionType::NOTIFICATIONS,
342 CONTENT_SETTINGS_TYPE_NOTIFICATIONS); 537 CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
343 TestRequestPermissionInvalidUrl(content::PermissionType::MIDI_SYSEX, 538 TestRequestPermissionInvalidUrl(content::PermissionType::MIDI_SYSEX,
344 CONTENT_SETTINGS_TYPE_MIDI_SYSEX); 539 CONTENT_SETTINGS_TYPE_MIDI_SYSEX);
345 TestRequestPermissionInvalidUrl(content::PermissionType::PUSH_MESSAGING, 540 TestRequestPermissionInvalidUrl(content::PermissionType::PUSH_MESSAGING,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 TestParallelRequests(CONTENT_SETTING_ALLOW); 612 TestParallelRequests(CONTENT_SETTING_ALLOW);
418 } 613 }
419 614
420 TEST_F(PermissionContextBaseTests, TestParallelRequestsBlocked) { 615 TEST_F(PermissionContextBaseTests, TestParallelRequestsBlocked) {
421 TestParallelRequests(CONTENT_SETTING_BLOCK); 616 TestParallelRequests(CONTENT_SETTING_BLOCK);
422 } 617 }
423 618
424 TEST_F(PermissionContextBaseTests, TestParallelRequestsDismissed) { 619 TEST_F(PermissionContextBaseTests, TestParallelRequestsDismissed) {
425 TestParallelRequests(CONTENT_SETTING_ASK); 620 TestParallelRequests(CONTENT_SETTING_ASK);
426 } 621 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_context_base.cc ('k') | chrome/browser/permissions/permission_decision_auto_blocker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698