Index: chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc |
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc |
index 3d6895c559d3856079aab304eb38a3142c7e4d0d..b1ec324d42d426afe1024e00ddc6347d7ff8d7e8 100644 |
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc |
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc |
@@ -42,6 +42,12 @@ class TestWebRequestRulesRegistry : public WebRequestRulesRegistry { |
// to be cleared. |
int num_clear_cache_calls() const { return num_clear_cache_calls_; } |
+ // How many rules are there which have some conditions not triggered by URL |
+ // matches. |
+ size_t RulesWithoutTriggers() const { |
+ return rules_with_untriggered_conditions_for_test().size(); |
+ } |
+ |
protected: |
virtual ~TestWebRequestRulesRegistry() {} |
@@ -263,6 +269,7 @@ TEST_F(WebRequestRulesRegistryTest, RemoveRulesImpl) { |
std::vector<linked_ptr<RulesRegistry::Rule> > registered_rules; |
registry->GetAllRules(kExtensionId, ®istered_rules); |
EXPECT_EQ(2u, registered_rules.size()); |
+ EXPECT_EQ(1u, registry->RulesWithoutTriggers()); |
// Remove first rule. |
std::vector<std::string> rules_to_remove; |
@@ -275,6 +282,7 @@ TEST_F(WebRequestRulesRegistryTest, RemoveRulesImpl) { |
registered_rules.clear(); |
registry->GetAllRules(kExtensionId, ®istered_rules); |
EXPECT_EQ(1u, registered_rules.size()); |
+ EXPECT_EQ(1u, registry->RulesWithoutTriggers()); |
// Now rules_to_remove contains both rules, i.e. one that does not exist in |
// the rules registry anymore. Effectively we only remove the second rule. |
@@ -287,6 +295,7 @@ TEST_F(WebRequestRulesRegistryTest, RemoveRulesImpl) { |
registered_rules.clear(); |
registry->GetAllRules(kExtensionId, ®istered_rules); |
EXPECT_EQ(0u, registered_rules.size()); |
+ EXPECT_EQ(0u, registry->RulesWithoutTriggers()); |
EXPECT_TRUE(registry->IsEmpty()); |
} |