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

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

Issue 2505153002: Add support for scout to 'ext' param when creating SafeBrowsing ping URLs. (Closed)
Patch Set: Go back to IsExtendedReportingEnabled where level doesn't matter Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/safe_browsing/ping_manager.cc ('k') | chrome/browser/safe_browsing/protocol_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/ping_manager_unittest.cc
diff --git a/chrome/browser/safe_browsing/ping_manager_unittest.cc b/chrome/browser/safe_browsing/ping_manager_unittest.cc
index 587680b6e51758314fd63b0946fc729462f6856e..7a7c162f2e8ef4c8eef2e56f44277c351c3ee23e 100644
--- a/chrome/browser/safe_browsing/ping_manager_unittest.cc
+++ b/chrome/browser/safe_browsing/ping_manager_unittest.cc
@@ -88,7 +88,7 @@ TEST_F(SafeBrowsingPingManagerTest, TestSafeBrowsingHitUrl) {
hp.threat_type = SB_THREAT_TYPE_URL_MALWARE;
hp.threat_source = ThreatSource::LOCAL_PVER3;
hp.is_subresource = true;
- hp.is_extended_reporting = true;
+ hp.extended_reporting_level = SBER_LEVEL_LEGACY;
hp.is_metrics_reporting_active = true;
EXPECT_EQ(
@@ -106,7 +106,7 @@ TEST_F(SafeBrowsingPingManagerTest, TestSafeBrowsingHitUrl) {
hp.threat_type = SB_THREAT_TYPE_URL_PHISHING;
hp.threat_source = ThreatSource::DATA_SAVER;
hp.is_subresource = false;
- hp.is_extended_reporting = true;
+ hp.extended_reporting_level = SBER_LEVEL_LEGACY;
hp.is_metrics_reporting_active = true;
EXPECT_EQ(
"https://prefix.com/foo/report?client=unittest&appver=1.0&"
@@ -121,9 +121,27 @@ TEST_F(SafeBrowsingPingManagerTest, TestSafeBrowsingHitUrl) {
{
HitReport hp(base_hp);
+ hp.threat_type = SB_THREAT_TYPE_URL_PHISHING;
+ hp.threat_source = ThreatSource::DATA_SAVER;
+ hp.is_subresource = false;
+ hp.extended_reporting_level = SBER_LEVEL_SCOUT;
+ hp.is_metrics_reporting_active = true;
+ EXPECT_EQ(
+ "https://prefix.com/foo/report?client=unittest&appver=1.0&"
+ "pver=3.0" +
+ key_param_ +
+ "&ext=2&evts=phishblhit&"
+ "evtd=http%3A%2F%2Fmalicious.url.com%2F&"
+ "evtr=http%3A%2F%2Fpage.url.com%2F&evhr=http%3A%2F%2Freferrer."
+ "url.com%2F&evtb=0&src=ds&m=1",
+ ping_manager()->SafeBrowsingHitUrl(hp).spec());
+ }
+
+ {
+ HitReport hp(base_hp);
hp.threat_type = SB_THREAT_TYPE_BINARY_MALWARE_URL;
hp.threat_source = ThreatSource::REMOTE;
- hp.is_extended_reporting = false;
+ hp.extended_reporting_level = SBER_LEVEL_OFF;
hp.is_metrics_reporting_active = true;
hp.is_subresource = false;
EXPECT_EQ(
@@ -141,7 +159,7 @@ TEST_F(SafeBrowsingPingManagerTest, TestSafeBrowsingHitUrl) {
HitReport hp(base_hp);
hp.threat_type = SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL;
hp.threat_source = ThreatSource::LOCAL_PVER4;
- hp.is_extended_reporting = false;
+ hp.extended_reporting_level = SBER_LEVEL_OFF;
hp.is_metrics_reporting_active = false;
hp.is_subresource = false;
EXPECT_EQ(
@@ -159,7 +177,7 @@ TEST_F(SafeBrowsingPingManagerTest, TestSafeBrowsingHitUrl) {
HitReport hp(base_hp);
hp.threat_type = SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL;
hp.threat_source = ThreatSource::LOCAL_PVER4;
- hp.is_extended_reporting = false;
+ hp.extended_reporting_level = SBER_LEVEL_OFF;
hp.is_metrics_reporting_active = false;
hp.is_subresource = true;
EXPECT_EQ(
@@ -178,7 +196,7 @@ TEST_F(SafeBrowsingPingManagerTest, TestSafeBrowsingHitUrl) {
HitReport hp(base_hp);
hp.threat_type = SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL;
hp.threat_source = ThreatSource::LOCAL_PVER4;
- hp.is_extended_reporting = false;
+ hp.extended_reporting_level = SBER_LEVEL_OFF;
hp.is_metrics_reporting_active = false;
hp.is_subresource = true;
hp.population_id = "foo bar";
@@ -266,7 +284,7 @@ TEST_F(SafeBrowsingPingManagerTest, TestReportSafeBrowsingHit) {
hp.referrer_url = GURL("http://referrer.url.com");
hp.threat_type = SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL;
hp.threat_source = ThreatSource::LOCAL_PVER4;
- hp.is_extended_reporting = false;
+ hp.extended_reporting_level = SBER_LEVEL_OFF;
hp.is_metrics_reporting_active = false;
hp.is_subresource = true;
hp.population_id = "foo bar";
« no previous file with comments | « chrome/browser/safe_browsing/ping_manager.cc ('k') | chrome/browser/safe_browsing/protocol_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698