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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page_test.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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fake safebrowsing service, where we can inject known- 5 // This test creates a fake safebrowsing service, where we can inject known-
6 // threat urls. It then uses a real browser to go to these urls, and sends 6 // threat urls. It then uses a real browser to go to these urls, and sends
7 // "goback" or "proceed" commands and verifies they work. 7 // "goback" or "proceed" commands and verifies they work.
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 EXPECT_FALSE(threat_details_done_callback_.is_null()); 187 EXPECT_FALSE(threat_details_done_callback_.is_null());
188 if (!threat_details_done_callback_.is_null()) { 188 if (!threat_details_done_callback_.is_null()) {
189 threat_details_done_callback_.Run(); 189 threat_details_done_callback_.Run();
190 threat_details_done_callback_ = base::Closure(); 190 threat_details_done_callback_ = base::Closure();
191 } 191 }
192 threat_details_done_ = true; 192 threat_details_done_ = true;
193 } 193 }
194 194
195 void MaybeReportSafeBrowsingHit(const HitReport& hit_report, 195 void MaybeReportSafeBrowsingHit(const HitReport& hit_report,
196 WebContents* web_contents) override { 196 const WebContents* web_contents) override {
197 if (SafeBrowsingUIManager::ShouldSendHitReport(hit_report, web_contents)) { 197 if (SafeBrowsingUIManager::ShouldSendHitReport(hit_report, web_contents)) {
198 hit_report_sent_ = true; 198 hit_report_sent_ = true;
199 } 199 }
200 } 200 }
201 201
202 bool hit_report_sent() { return hit_report_sent_; } 202 bool hit_report_sent() { return hit_report_sent_; }
203 203
204 void set_threat_details_done_callback(const base::Closure& callback) { 204 void set_threat_details_done_callback(const base::Closure& callback) {
205 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI)); 205 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI));
206 EXPECT_TRUE(threat_details_done_callback_.is_null()); 206 EXPECT_TRUE(threat_details_done_callback_.is_null());
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 1566
1567 INSTANTIATE_TEST_CASE_P( 1567 INSTANTIATE_TEST_CASE_P(
1568 SafeBrowsingBlockingPageIDNTestWithThreatType, 1568 SafeBrowsingBlockingPageIDNTestWithThreatType,
1569 SafeBrowsingBlockingPageIDNTest, 1569 SafeBrowsingBlockingPageIDNTest,
1570 testing::Combine(testing::Values(false, true), 1570 testing::Combine(testing::Values(false, true),
1571 testing::Values(SB_THREAT_TYPE_URL_MALWARE, 1571 testing::Values(SB_THREAT_TYPE_URL_MALWARE,
1572 SB_THREAT_TYPE_URL_PHISHING, 1572 SB_THREAT_TYPE_URL_PHISHING,
1573 SB_THREAT_TYPE_URL_UNWANTED))); 1573 SB_THREAT_TYPE_URL_UNWANTED)));
1574 1574
1575 } // namespace safe_browsing 1575 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698