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

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

Issue 2841933003: [subresource_filter] Remove some state from the driver factory (Closed)
Patch Set: no more dep branch 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 side-by-side diff with in-line comments
Download patch
Index: components/subresource_filter/content/browser/content_subresource_filter_throttle_manager_unittest.cc
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager_unittest.cc b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager_unittest.cc
index c020f88c01c0204158632a57ae981276e3f31a50..baf987ecf93532b8400a8e3409e1686de1c401f4 100644
--- a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager_unittest.cc
+++ b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager_unittest.cc
@@ -4,7 +4,10 @@
#include "components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h"
+#include <map>
#include <memory>
+#include <set>
+#include <tuple>
#include <utility>
#include "base/logging.h"
@@ -83,8 +86,12 @@ class MockPageStateActivationThrottle : public content::NavigationThrottle {
if (throttle_state == activation_throttle_state_) {
auto it = mock_page_activations_.find(navigation_handle()->GetURL());
if (it != mock_page_activations_.end()) {
- throttle_manager_->NotifyPageActivationComputed(navigation_handle(),
- it->second);
+ throttle_manager_->NotifyPageActivationComputed(
+ navigation_handle(), it->second, ActivationDecision::ACTIVATED);
+ } else {
+ throttle_manager_->NotifyPageActivationComputed(
+ navigation_handle(), ActivationState(ActivationLevel::DISABLED),
+ ActivationDecision::ACTIVATION_LIST_NOT_MATCHED);
}
}
return content::NavigationThrottle::PROCEED;
@@ -260,8 +267,10 @@ class ContentSubresourceFilterThrottleManagerTest
::testing::UnitTest::GetInstance()->current_test_info()->value_param()
? GetParam()
: WILL_PROCESS_RESPONSE;
- throttles.push_back(base::MakeUnique<MockPageStateActivationThrottle>(
- navigation_handle, state, throttle_manager_.get()));
+ if (navigation_handle->IsInMainFrame()) {
+ throttles.push_back(base::MakeUnique<MockPageStateActivationThrottle>(
+ navigation_handle, state, throttle_manager_.get()));
+ }
throttle_manager_->MaybeAppendNavigationThrottles(navigation_handle,
&throttles);
for (auto& it : throttles) {

Powered by Google App Engine
This is Rietveld 408576698