| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |