| OLD | NEW |
| 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 Loading... |
| 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_METHOD2(OnActivationComputed, |
| 71 void(const GURL&, const subresource_filter::ActivationState&)); |
| 70 | 72 |
| 71 private: | 73 private: |
| 72 DISALLOW_COPY_AND_ASSIGN(MockSubresourceFilterClient); | 74 DISALLOW_COPY_AND_ASSIGN(MockSubresourceFilterClient); |
| 73 }; | 75 }; |
| 74 | 76 |
| 75 // Throttle to call WillProcessResponse on the factory, which is otherwise | 77 // Throttle to call WillProcessResponse on the factory, which is otherwise |
| 76 // called by the ThrottleManager. | 78 // called by the ThrottleManager. |
| 77 class TestForwardingNavigationThrottle : public content::NavigationThrottle { | 79 class TestForwardingNavigationThrottle : public content::NavigationThrottle { |
| 78 public: | 80 public: |
| 79 TestForwardingNavigationThrottle(content::NavigationHandle* handle) | 81 TestForwardingNavigationThrottle(content::NavigationHandle* handle) |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 0); | 263 0); |
| 262 tester().ExpectTotalCount(kNavigationChainSizeSubresourceFilterSuffix, 0); | 264 tester().ExpectTotalCount(kNavigationChainSizeSubresourceFilterSuffix, 0); |
| 263 } | 265 } |
| 264 | 266 |
| 265 // TODO(melandory): Once non-defering check in WillStart is implemented add one | 267 // TODO(melandory): Once non-defering check in WillStart is implemented add one |
| 266 // more test that destroys the Navigation along with corresponding throttles | 268 // 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 | 269 // while the SB check is pending? (To be run by ASAN bots to ensure |
| 268 // no use-after-free.) | 270 // no use-after-free.) |
| 269 | 271 |
| 270 } // namespace subresource_filter | 272 } // namespace subresource_filter |
| OLD | NEW |