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

Side by Side Diff: chrome/browser/safe_browsing/permission_reporter_unittest.cc

Issue 2715643002: Replace all enums with enum classes in permissions code. (Closed)
Patch Set: Rebase Created 3 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 | « chrome/browser/safe_browsing/permission_reporter.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/safe_browsing/permission_reporter.h" 5 #include "chrome/browser/safe_browsing/permission_reporter.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/test/scoped_feature_list.h" 9 #include "base/test/scoped_feature_list.h"
10 #include "base/test/simple_test_clock.h" 10 #include "base/test/simple_test_clock.h"
(...skipping 14 matching lines...) Expand all
25 "chrome-permissions"; 25 "chrome-permissions";
26 26
27 const int kMaximumReportsPerOriginPerPermissionPerMinute = 5; 27 const int kMaximumReportsPerOriginPerPermissionPerMinute = 5;
28 28
29 const char kDummyOriginOne[] = "http://example.test/"; 29 const char kDummyOriginOne[] = "http://example.test/";
30 const char kDummyOriginTwo[] = "http://example2.test/"; 30 const char kDummyOriginTwo[] = "http://example2.test/";
31 const ContentSettingsType kDummyPermissionOne = 31 const ContentSettingsType kDummyPermissionOne =
32 CONTENT_SETTINGS_TYPE_GEOLOCATION; 32 CONTENT_SETTINGS_TYPE_GEOLOCATION;
33 const ContentSettingsType kDummyPermissionTwo = 33 const ContentSettingsType kDummyPermissionTwo =
34 CONTENT_SETTINGS_TYPE_NOTIFICATIONS; 34 CONTENT_SETTINGS_TYPE_NOTIFICATIONS;
35 const PermissionAction kDummyAction = GRANTED; 35 const PermissionAction kDummyAction = PermissionAction::GRANTED;
36 const PermissionSourceUI kDummySourceUI = PermissionSourceUI::PROMPT; 36 const PermissionSourceUI kDummySourceUI = PermissionSourceUI::PROMPT;
37 const PermissionRequestGestureType kDummyGestureType = 37 const PermissionRequestGestureType kDummyGestureType =
38 PermissionRequestGestureType::GESTURE; 38 PermissionRequestGestureType::GESTURE;
39 const PermissionPersistDecision kDummyPersistDecision = 39 const PermissionPersistDecision kDummyPersistDecision =
40 PermissionPersistDecision::PERSISTED; 40 PermissionPersistDecision::PERSISTED;
41 const int kDummyNumPriorDismissals = 10; 41 const int kDummyNumPriorDismissals = 10;
42 const int kDummyNumPriorIgnores = 12; 42 const int kDummyNumPriorIgnores = 12;
43 43
44 const char kDummyTrialOne[] = "trial one"; 44 const char kDummyTrialOne[] = "trial one";
45 const char kDummyGroupOne[] = "group one"; 45 const char kDummyGroupOne[] = "group one";
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 reports_to_send = 12; 209 reports_to_send = 12;
210 while (reports_to_send--) { 210 while (reports_to_send--) {
211 clock_->Advance(base::TimeDelta::FromSeconds(5)); 211 clock_->Advance(base::TimeDelta::FromSeconds(5));
212 permission_reporter_->SendReport(BuildDummyReportInfo()); 212 permission_reporter_->SendReport(BuildDummyReportInfo());
213 } 213 }
214 EXPECT_EQ(kMaximumReportsPerOriginPerPermissionPerMinute, 214 EXPECT_EQ(kMaximumReportsPerOriginPerPermissionPerMinute,
215 mock_report_sender_->GetAndResetNumberOfReportsSent()); 215 mock_report_sender_->GetAndResetNumberOfReportsSent());
216 } 216 }
217 217
218 } // namespace safe_browsing 218 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/permission_reporter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698