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

Unified Diff: components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc

Issue 2897613002: Revert of [subresource_filter] Remove Forwarding NavigationThrottles (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 side-by-side diff with in-line comments
Download patch
Index: components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc
index 48ba44860aee0d666e5121a5b11f5622a24f4feb..8793a243cf1a30bf04f9ec2a55193fd3ffcc0ca2 100644
--- a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc
+++ b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc
@@ -311,18 +311,20 @@
navigation_simulator->SetTransition(transition);
navigation_simulator->Start();
+ if (blacklisted_urls.front()) {
+ factory()->OnMainResourceMatchedSafeBrowsingBlacklist(
+ navigation_chain.front(), threat_type, threat_type_metadata);
+ }
::testing::Mock::VerifyAndClearExpectations(client());
- for (size_t i = 1; i < navigation_chain.size(); ++i)
- navigation_simulator->Redirect(navigation_chain[i]);
-
- if (blacklisted_urls.size() != navigation_chain.size() ||
- !blacklisted_urls.back()) {
- threat_type = safe_browsing::SBThreatType::SB_THREAT_TYPE_SAFE;
- threat_type_metadata = safe_browsing::ThreatPatternType::NONE;
+
+ for (size_t i = 1; i < navigation_chain.size(); ++i) {
+ const GURL url = navigation_chain[i];
+ if (i < blacklisted_urls.size() && blacklisted_urls[i]) {
+ factory()->OnMainResourceMatchedSafeBrowsingBlacklist(
+ url, threat_type, threat_type_metadata);
+ }
+ navigation_simulator->Redirect(url);
}
- factory()->OnSafeBrowsingMatchComputed(
- navigation_simulator->GetNavigationHandle(), threat_type,
- threat_type_metadata);
std::string suffix;
ActivationList activation_list =
GetListForThreatTypeAndMetadata(threat_type, threat_type_metadata);

Powered by Google App Engine
This is Rietveld 408576698