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

Side by Side Diff: components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle_unittest.cc

Issue 2830353003: Tracing for NavigationHandle lifetime and state. (Closed)
Patch Set: Rebase. Created 3 years, 8 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "components/subresource_filter/content/browser/subresource_filter_safe_ browsing_activation_throttle.h" 5 #include "components/subresource_filter/content/browser/subresource_filter_safe_ browsing_activation_throttle.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 // content::NavigationThrottle: 83 // content::NavigationThrottle:
84 content::NavigationThrottle::ThrottleCheckResult WillProcessResponse() 84 content::NavigationThrottle::ThrottleCheckResult WillProcessResponse()
85 override { 85 override {
86 content::WebContents* web_contents = navigation_handle()->GetWebContents(); 86 content::WebContents* web_contents = navigation_handle()->GetWebContents();
87 ContentSubresourceFilterDriverFactory* factory = 87 ContentSubresourceFilterDriverFactory* factory =
88 ContentSubresourceFilterDriverFactory::FromWebContents(web_contents); 88 ContentSubresourceFilterDriverFactory::FromWebContents(web_contents);
89 factory->WillProcessResponse(navigation_handle()); 89 factory->WillProcessResponse(navigation_handle());
90 return content::NavigationThrottle::PROCEED; 90 return content::NavigationThrottle::PROCEED;
91 } 91 }
92 const char* GetNameForLogging() override {
93 return "TestForwardingNavigationThrottle";
94 }
92 95
93 private: 96 private:
94 DISALLOW_COPY_AND_ASSIGN(TestForwardingNavigationThrottle); 97 DISALLOW_COPY_AND_ASSIGN(TestForwardingNavigationThrottle);
95 }; 98 };
96 99
97 } // namespace 100 } // namespace
98 101
99 class SubresourceFilterSafeBrowsingActivationThrottleTest 102 class SubresourceFilterSafeBrowsingActivationThrottleTest
100 : public content::RenderViewHostTestHarness, 103 : public content::RenderViewHostTestHarness,
101 public content::WebContentsObserver { 104 public content::WebContentsObserver {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 0); 261 0);
259 tester().ExpectTotalCount(kNavigationChainSizeSubresourceFilterSuffix, 0); 262 tester().ExpectTotalCount(kNavigationChainSizeSubresourceFilterSuffix, 0);
260 } 263 }
261 264
262 // TODO(melandory): Once non-defering check in WillStart is implemented add one 265 // TODO(melandory): Once non-defering check in WillStart is implemented add one
263 // more test that destroys the Navigation along with corresponding throttles 266 // more test that destroys the Navigation along with corresponding throttles
264 // while the SB check is pending? (To be run by ASAN bots to ensure 267 // while the SB check is pending? (To be run by ASAN bots to ensure
265 // no use-after-free.) 268 // no use-after-free.)
266 269
267 } // namespace subresource_filter 270 } // namespace subresource_filter
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698