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

Unified Diff: chrome/browser/safe_browsing/permission_reporter_unittest.cc

Issue 2075523002: Add SourceUI field to permission report (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/permission_reporter_unittest.cc
diff --git a/chrome/browser/safe_browsing/permission_reporter_unittest.cc b/chrome/browser/safe_browsing/permission_reporter_unittest.cc
index d64db60c4ae428458061366707d567d8569550c7..a0eab12a2034807755d984b41cc5bf99066b007a 100644
--- a/chrome/browser/safe_browsing/permission_reporter_unittest.cc
+++ b/chrome/browser/safe_browsing/permission_reporter_unittest.cc
@@ -23,10 +23,13 @@ static const char kPermissionActionReportingUploadUrl[] =
static const char kDummyOrigin[] = "http://example.test/";
static const PermissionType kDummyPermission = PermissionType::GEOLOCATION;
static const PermissionAction kDummyAction = GRANTED;
+static const SourceUI kDummySourceUI = PROMPT;
static const PermissionReport::PermissionType kDummyPermissionReportPermission =
PermissionReport::GEOLOCATION;
static const PermissionReport::Action kDummyPermissionReportAction =
PermissionReport::GRANTED;
+static const PermissionReport::SourceUI kDummyPermissionReportSourceUI =
+ PermissionReport::PROMPT;
// A mock ReportSender that keeps track of the last report sent.
class MockReportSender : public net::ReportSender {
@@ -69,13 +72,14 @@ class PermissionReporterTest : public ::testing::Test {
// SafeBrowsing CSD servers.
TEST_F(PermissionReporterTest, SendReport) {
permission_reporter_->SendReport(GURL(kDummyOrigin), kDummyPermission,
- kDummyAction);
+ kDummyAction, kDummySourceUI);
PermissionReport permission_report;
ASSERT_TRUE(
permission_report.ParseFromString(mock_report_sender_->latest_report()));
EXPECT_EQ(kDummyPermissionReportPermission, permission_report.permission());
EXPECT_EQ(kDummyPermissionReportAction, permission_report.action());
+ EXPECT_EQ(kDummyPermissionReportSourceUI, permission_report.source_ui());
EXPECT_EQ(kDummyOrigin, permission_report.origin());
EXPECT_EQ(GURL(kPermissionActionReportingUploadUrl),

Powered by Google App Engine
This is Rietveld 408576698