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

Unified Diff: components/subresource_filter/content/browser/subresource_filter_navigation_throttle_unittests.cc

Issue 2396133003: Change the logic how Subesource Filter propagates activation. (Closed)
Patch Set: fix test, for real now Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/subresource_filter/content/browser/subresource_filter_navigation_throttle_unittests.cc
diff --git a/components/subresource_filter/content/browser/subresource_filter_navigation_throttle_unittests.cc b/components/subresource_filter/content/browser/subresource_filter_navigation_throttle_unittests.cc
index 952cbec896064677e512cb9c4280cf20dccd77e5..54a9501dddf41930449527163509e3da0d1d5d98 100644
--- a/components/subresource_filter/content/browser/subresource_filter_navigation_throttle_unittests.cc
+++ b/components/subresource_filter/content/browser/subresource_filter_navigation_throttle_unittests.cc
@@ -170,8 +170,8 @@ TEST_F(SubresourceFilterNavigationThrottleTest,
SimulateWillProcessResponse();
::testing::Mock::VerifyAndClearExpectations(driver());
- EXPECT_EQ(1U, factory()->activation_set().size());
- EXPECT_TRUE(factory()->ShouldActivateForURL(url_with_activation));
+ EXPECT_EQ(0U, factory()->activation_set().size());
+ EXPECT_FALSE(factory()->ShouldActivateForURL(url_with_activation));
EXPECT_FALSE(factory()->ShouldActivateForURL(url_without_activation));
}
@@ -227,9 +227,9 @@ TEST_F(SubresourceFilterNavigationThrottleTest,
SimulateWillProcessResponse();
::testing::Mock::VerifyAndClearExpectations(driver());
- EXPECT_EQ(2U, factory()->activation_set().size());
+ EXPECT_EQ(1U, factory()->activation_set().size());
EXPECT_TRUE(factory()->ShouldActivateForURL(url));
- EXPECT_TRUE(factory()->ShouldActivateForURL(redirect));
+ EXPECT_FALSE(factory()->ShouldActivateForURL(redirect));
}
TEST_F(SubresourceFilterNavigationThrottleTest,
@@ -266,12 +266,12 @@ TEST_F(SubresourceFilterNavigationThrottleTest,
SimulateWillProcessResponse();
::testing::Mock::VerifyAndClearExpectations(driver());
- EXPECT_EQ(redirects.size() + 2U, factory()->activation_set().size());
+ EXPECT_EQ(1U, factory()->activation_set().size());
EXPECT_TRUE(factory()->ShouldActivateForURL(url));
- EXPECT_TRUE(factory()->ShouldActivateForURL(first_redirect));
- EXPECT_TRUE(factory()->ShouldActivateForURL(second_redirect));
- EXPECT_TRUE(factory()->ShouldActivateForURL(third_redirect));
- EXPECT_TRUE(
+ EXPECT_FALSE(factory()->ShouldActivateForURL(first_redirect));
+ EXPECT_FALSE(factory()->ShouldActivateForURL(second_redirect));
+ EXPECT_FALSE(factory()->ShouldActivateForURL(third_redirect));
+ EXPECT_FALSE(
factory()->ShouldActivateForURL(redirect_after_sb_classification));
}
@@ -301,10 +301,10 @@ TEST_F(SubresourceFilterNavigationThrottleTest,
SimulateWillProcessResponse();
::testing::Mock::VerifyAndClearExpectations(driver());
- EXPECT_EQ(3U, factory()->activation_set().size());
+ EXPECT_EQ(1U, factory()->activation_set().size());
EXPECT_TRUE(factory()->ShouldActivateForURL(init_url));
- EXPECT_TRUE(factory()->ShouldActivateForURL(redirect_with_match));
- EXPECT_TRUE(factory()->ShouldActivateForURL(final_url));
+ EXPECT_FALSE(factory()->ShouldActivateForURL(redirect_with_match));
+ EXPECT_FALSE(factory()->ShouldActivateForURL(final_url));
}
} // namespace subresource_filter

Powered by Google App Engine
This is Rietveld 408576698