Index: components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle_unittest.cc |
diff --git a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle_unittest.cc b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle_unittest.cc |
index 364a3af6271c78887d7362beb6ef5b8045270a5c..20804b31a9afaf9f1beb4733dec749802a18f984 100644 |
--- a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle_unittest.cc |
+++ b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle_unittest.cc |
@@ -82,6 +82,31 @@ |
DISALLOW_COPY_AND_ASSIGN(MockSubresourceFilterClient); |
}; |
+// Throttle to call WillProcessResponse on the factory, which is otherwise |
+// called by the ThrottleManager. |
+class TestForwardingNavigationThrottle : public content::NavigationThrottle { |
+ public: |
+ explicit TestForwardingNavigationThrottle(content::NavigationHandle* handle) |
+ : content::NavigationThrottle(handle) {} |
+ ~TestForwardingNavigationThrottle() override {} |
+ |
+ // content::NavigationThrottle: |
+ content::NavigationThrottle::ThrottleCheckResult WillProcessResponse() |
+ override { |
+ content::WebContents* web_contents = navigation_handle()->GetWebContents(); |
+ ContentSubresourceFilterDriverFactory* factory = |
+ ContentSubresourceFilterDriverFactory::FromWebContents(web_contents); |
+ factory->WillProcessResponse(navigation_handle()); |
+ return content::NavigationThrottle::PROCEED; |
+ } |
+ const char* GetNameForLogging() override { |
+ return "TestForwardingNavigationThrottle"; |
+ } |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(TestForwardingNavigationThrottle); |
+}; |
+ |
std::string GetSuffixForList(const ActivationList& type) { |
switch (type) { |
case ActivationList::SOCIAL_ENG_ADS_INTERSTITIAL: |
@@ -173,6 +198,8 @@ |
base::MakeUnique<SubresourceFilterSafeBrowsingActivationThrottle>( |
navigation_handle, test_io_task_runner_, |
fake_safe_browsing_database_)); |
+ navigation_handle->RegisterThrottleForTesting( |
+ base::MakeUnique<TestForwardingNavigationThrottle>(navigation_handle)); |
} |
content::NavigationThrottle::ThrottleCheckResult SimulateStart() { |