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

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

Issue 2896893002: Minor revisions to incognito hit report code (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This test creates a safebrowsing service using test safebrowsing database 5 // This test creates a safebrowsing service using test safebrowsing database
6 // and a test protocol manager. It is used to test logics in safebrowsing 6 // and a test protocol manager. It is used to test logics in safebrowsing
7 // service. 7 // service.
8 8
9 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 9 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
10 10
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 config.url_prefix = url_prefix; 145 config.url_prefix = url_prefix;
146 // Makes sure the auto update is not triggered. The tests will force the 146 // Makes sure the auto update is not triggered. The tests will force the
147 // update when needed. 147 // update when needed.
148 config.disable_auto_update = true; 148 config.disable_auto_update = true;
149 config.client_name = "browser_tests"; 149 config.client_name = "browser_tests";
150 factory->SetTestProtocolConfig(config); 150 factory->SetTestProtocolConfig(config);
151 } 151 }
152 152
153 class FakeSafeBrowsingUIManager : public TestSafeBrowsingUIManager { 153 class FakeSafeBrowsingUIManager : public TestSafeBrowsingUIManager {
154 public: 154 public:
155 void MaybeReportSafeBrowsingHit(const safe_browsing::HitReport& hit_report, 155 void MaybeReportSafeBrowsingHit(
156 content::WebContents* web_contents) override { 156 const safe_browsing::HitReport& hit_report,
157 const content::WebContents* web_contents) override {
157 EXPECT_FALSE(got_hit_report_); 158 EXPECT_FALSE(got_hit_report_);
158 got_hit_report_ = true; 159 got_hit_report_ = true;
159 hit_report_ = hit_report; 160 hit_report_ = hit_report;
160 SafeBrowsingUIManager::MaybeReportSafeBrowsingHit(hit_report, web_contents); 161 SafeBrowsingUIManager::MaybeReportSafeBrowsingHit(hit_report, web_contents);
161 } 162 }
162 163
163 bool got_hit_report_ = false; 164 bool got_hit_report_ = false;
164 safe_browsing::HitReport hit_report_; 165 safe_browsing::HitReport hit_report_;
165 166
166 private: 167 private:
(...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after
2347 } 2348 }
2348 2349
2349 INSTANTIATE_TEST_CASE_P( 2350 INSTANTIATE_TEST_CASE_P(
2350 MaybeSetMetadata, 2351 MaybeSetMetadata,
2351 V4SafeBrowsingServiceMetadataTest, 2352 V4SafeBrowsingServiceMetadataTest,
2352 testing::Values(ThreatPatternType::NONE, 2353 testing::Values(ThreatPatternType::NONE,
2353 ThreatPatternType::MALWARE_LANDING, 2354 ThreatPatternType::MALWARE_LANDING,
2354 ThreatPatternType::MALWARE_DISTRIBUTION)); 2355 ThreatPatternType::MALWARE_DISTRIBUTION));
2355 2356
2356 } // namespace safe_browsing 2357 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc ('k') | chrome/browser/safe_browsing/ui_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698