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

Unified Diff: components/safe_browsing/password_protection/password_protection_service_unittest.cc

Issue 2856033002: Add finch control of user population in low reputation requests (Closed)
Patch Set: rebase Created 3 years, 7 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: components/safe_browsing/password_protection/password_protection_service_unittest.cc
diff --git a/components/safe_browsing/password_protection/password_protection_service_unittest.cc b/components/safe_browsing/password_protection/password_protection_service_unittest.cc
index 3691dc31b18aef8c2318667784cadf5a68638701..547f23ceb98afa52e9009b37672e39f46e1c9119 100644
--- a/components/safe_browsing/password_protection/password_protection_service_unittest.cc
+++ b/components/safe_browsing/password_protection/password_protection_service_unittest.cc
@@ -97,7 +97,9 @@ class TestPasswordProtectionService : public PasswordProtectionService {
void set_incognito(bool enabled) { is_incognito_ = enabled; }
- bool IsPingingEnabled() override { return true; }
+ bool IsPingingEnabled(const base::Feature& feature) override { return true; }
+
+ bool IsHistorySyncEnabled() override { return false; }
LoginReputationClientResponse* latest_response() {
return latest_response_.get();
@@ -425,35 +427,6 @@ TEST_F(PasswordProtectionServiceTest,
EXPECT_EQ(0u, password_protection_service_->GetPendingRequestsCount());
}
-TEST_F(PasswordProtectionServiceTest, TestNoRequestSentForIncognito) {
- histograms_.ExpectTotalCount(kRequestOutcomeHistogramName, 0);
- password_protection_service_->set_incognito(true);
- password_protection_service_->StartRequest(
- GURL(kTargetUrl), GURL("http://foo.com/submit"),
- GURL("http://foo.com/frame"),
- LoginReputationClientRequest::UNFAMILIAR_LOGIN_PAGE);
- base::RunLoop().RunUntilIdle();
- EXPECT_EQ(nullptr, password_protection_service_->latest_response());
- EXPECT_THAT(histograms_.GetAllSamples(kRequestOutcomeHistogramName),
- testing::ElementsAre(base::Bucket(7 /* INCOGNITO */, 1)));
-}
-
-TEST_F(PasswordProtectionServiceTest,
- TestNoRequestSentForNonExtendedReporting) {
- histograms_.ExpectTotalCount(kRequestOutcomeHistogramName, 0);
- password_protection_service_->set_extended_reporting(false);
- password_protection_service_->StartRequest(
- GURL(kTargetUrl), GURL("http://foo.com/submit"),
- GURL("http://foo.com/frame"),
- LoginReputationClientRequest::UNFAMILIAR_LOGIN_PAGE);
-
- base::RunLoop().RunUntilIdle();
- EXPECT_EQ(nullptr, password_protection_service_->latest_response());
- EXPECT_THAT(
- histograms_.GetAllSamples(kRequestOutcomeHistogramName),
- testing::ElementsAre(base::Bucket(6 /* NO_EXTENDED_REPORTING */, 1)));
-}
-
TEST_F(PasswordProtectionServiceTest, TestNoRequestSentForWhitelistedURL) {
histograms_.ExpectTotalCount(kRequestOutcomeHistogramName, 0);
InitializeAndStartRequest(true /* match whitelist */,

Powered by Google App Engine
This is Rietveld 408576698