OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_navig
ation_throttle.h" | 5 #include "components/subresource_filter/content/browser/subresource_filter_navig
ation_throttle.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 class SubresourceFilterNavigationThrottleTest | 65 class SubresourceFilterNavigationThrottleTest |
66 : public content::RenderViewHostTestHarness { | 66 : public content::RenderViewHostTestHarness { |
67 public: | 67 public: |
68 SubresourceFilterNavigationThrottleTest() {} | 68 SubresourceFilterNavigationThrottleTest() {} |
69 | 69 |
70 // content::RenderViewHostTestHarness: | 70 // content::RenderViewHostTestHarness: |
71 void SetUp() override { | 71 void SetUp() override { |
72 RenderViewHostTestHarness::SetUp(); | 72 RenderViewHostTestHarness::SetUp(); |
73 ContentSubresourceFilterDriverFactory::CreateForWebContents( | 73 ContentSubresourceFilterDriverFactory::CreateForWebContents( |
74 web_contents(), base::WrapUnique(new MockSubresourceFilterClient())); | 74 web_contents(), base::MakeUnique<MockSubresourceFilterClient>()); |
75 | 75 |
76 driver_ = new MockSubresourceFilterDriver(main_rfh()); | 76 driver_ = new MockSubresourceFilterDriver(main_rfh()); |
77 factory()->SetDriverForFrameHostForTesting(main_rfh(), | 77 factory()->SetDriverForFrameHostForTesting(main_rfh(), |
78 base::WrapUnique(driver_)); | 78 base::WrapUnique(driver_)); |
79 } | 79 } |
80 | 80 |
81 void TearDown() override { | 81 void TearDown() override { |
82 handle_.reset(); | 82 handle_.reset(); |
83 RenderViewHostTestHarness::TearDown(); | 83 RenderViewHostTestHarness::TearDown(); |
84 } | 84 } |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 SimulateWillProcessResponse(); | 300 SimulateWillProcessResponse(); |
301 ::testing::Mock::VerifyAndClearExpectations(driver()); | 301 ::testing::Mock::VerifyAndClearExpectations(driver()); |
302 | 302 |
303 EXPECT_EQ(3U, factory()->activation_set().size()); | 303 EXPECT_EQ(3U, factory()->activation_set().size()); |
304 EXPECT_TRUE(factory()->ShouldActivateForURL(init_url)); | 304 EXPECT_TRUE(factory()->ShouldActivateForURL(init_url)); |
305 EXPECT_TRUE(factory()->ShouldActivateForURL(redirect_with_match)); | 305 EXPECT_TRUE(factory()->ShouldActivateForURL(redirect_with_match)); |
306 EXPECT_TRUE(factory()->ShouldActivateForURL(final_url)); | 306 EXPECT_TRUE(factory()->ShouldActivateForURL(final_url)); |
307 } | 307 } |
308 | 308 |
309 } // namespace subresource_filter | 309 } // namespace subresource_filter |
OLD | NEW |