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

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

Issue 2838063002: [on-hold][subresource_filter] Add ActivationTracker to track all activated contents (Closed)
Patch Set: fix incognito 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 | « components/subresource_filter/content/browser/subresource_filter_client.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 public: 60 public:
61 MockSubresourceFilterClient() {} 61 MockSubresourceFilterClient() {}
62 62
63 ~MockSubresourceFilterClient() override = default; 63 ~MockSubresourceFilterClient() override = default;
64 64
65 MOCK_METHOD1(ToggleNotificationVisibility, void(bool)); 65 MOCK_METHOD1(ToggleNotificationVisibility, void(bool));
66 MOCK_METHOD1(ShouldSuppressActivation, bool(content::NavigationHandle*)); 66 MOCK_METHOD1(ShouldSuppressActivation, bool(content::NavigationHandle*));
67 MOCK_METHOD1(WhitelistByContentSettings, void(const GURL&)); 67 MOCK_METHOD1(WhitelistByContentSettings, void(const GURL&));
68 MOCK_METHOD1(WhitelistInCurrentWebContents, void(const GURL&)); 68 MOCK_METHOD1(WhitelistInCurrentWebContents, void(const GURL&));
69 MOCK_METHOD0(GetRulesetDealer, VerifiedRulesetDealer::Handle*()); 69 MOCK_METHOD0(GetRulesetDealer, VerifiedRulesetDealer::Handle*());
70 MOCK_METHOD1(OnPageActivated, void(const ActivationState&));
70 71
71 private: 72 private:
72 DISALLOW_COPY_AND_ASSIGN(MockSubresourceFilterClient); 73 DISALLOW_COPY_AND_ASSIGN(MockSubresourceFilterClient);
73 }; 74 };
74 75
75 // Throttle to call WillProcessResponse on the factory, which is otherwise 76 // Throttle to call WillProcessResponse on the factory, which is otherwise
76 // called by the ThrottleManager. 77 // called by the ThrottleManager.
77 class TestForwardingNavigationThrottle : public content::NavigationThrottle { 78 class TestForwardingNavigationThrottle : public content::NavigationThrottle {
78 public: 79 public:
79 TestForwardingNavigationThrottle(content::NavigationHandle* handle) 80 TestForwardingNavigationThrottle(content::NavigationHandle* handle)
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 0); 262 0);
262 tester().ExpectTotalCount(kNavigationChainSizeSubresourceFilterSuffix, 0); 263 tester().ExpectTotalCount(kNavigationChainSizeSubresourceFilterSuffix, 0);
263 } 264 }
264 265
265 // TODO(melandory): Once non-defering check in WillStart is implemented add one 266 // TODO(melandory): Once non-defering check in WillStart is implemented add one
266 // more test that destroys the Navigation along with corresponding throttles 267 // more test that destroys the Navigation along with corresponding throttles
267 // while the SB check is pending? (To be run by ASAN bots to ensure 268 // while the SB check is pending? (To be run by ASAN bots to ensure
268 // no use-after-free.) 269 // no use-after-free.)
269 270
270 } // namespace subresource_filter 271 } // namespace subresource_filter
OLDNEW
« no previous file with comments | « components/subresource_filter/content/browser/subresource_filter_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698