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

Unified Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_rule_unittest.cc

Issue 11414230: Declarative Web Request: firstPartyForCookiesUrl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added event order Created 8 years 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: chrome/browser/extensions/api/declarative_webrequest/webrequest_rule_unittest.cc
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rule_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rule_unittest.cc
index d3caa4e45dde1652e60f78e86e5df1cdae34e5be..314c5313f00f227082e2597b1ee6e300aea3a736 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rule_unittest.cc
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rule_unittest.cc
@@ -26,6 +26,7 @@ TEST(WebRequestRuleTest, Create) {
" { \n"
" \"instanceType\": \"declarativeWebRequest.RequestMatcher\", \n"
" \"url\": {\"hostSuffix\": \"foo.com\"}, \n"
+ " \"firstPartyForCookiesUrl\": {\"hostSuffix\": \"foo.com\"}, \n"
" \"contentType\": [\"image/jpeg\"] \n"
" } \n"
" ], \n"
@@ -44,10 +45,12 @@ TEST(WebRequestRuleTest, Create) {
ASSERT_TRUE(RulesRegistry::Rule::Populate(*value, rule.get()));
URLMatcher matcher;
+ URLMatcher first_party_matcher;
std::string error;
scoped_ptr<WebRequestRule> web_request_rule(
- WebRequestRule::Create(matcher.condition_factory(), kExtId, base::Time(),
- rule, &error));
+ WebRequestRule::Create(
+ matcher.condition_factory(), first_party_matcher.condition_factory(),
+ kExtId, base::Time(), rule, &error));
ASSERT_TRUE(web_request_rule.get());
EXPECT_TRUE(error.empty());
@@ -64,6 +67,10 @@ TEST(WebRequestRuleTest, Create) {
const WebRequestConditionAttributes& condition_attributes =
condition->condition_attributes();
ASSERT_EQ(1u, condition_attributes.size());
+ ASSERT_EQ(1u, condition->url_matcher_condition_set()->conditions().size());
+ ASSERT_EQ(1u,
+ condition->first_party_url_matcher_condition_set()->
+ conditions().size());
EXPECT_EQ(WebRequestConditionAttribute::CONDITION_CONTENT_TYPE,
condition_attributes[0]->GetType());
@@ -103,10 +110,12 @@ TEST(WebRequestRuleTest, CheckConsistency) {
ASSERT_TRUE(RulesRegistry::Rule::Populate(*value, rule.get()));
URLMatcher matcher;
+ URLMatcher first_party_matcher;
std::string error;
scoped_ptr<WebRequestRule> web_request_rule(
- WebRequestRule::Create(matcher.condition_factory(), kExtId, base::Time(),
- rule, &error));
+ WebRequestRule::Create(
+ matcher.condition_factory(), first_party_matcher.condition_factory(),
+ kExtId, base::Time(), rule, &error));
EXPECT_FALSE(web_request_rule.get());
EXPECT_FALSE(error.empty());
}

Powered by Google App Engine
This is Rietveld 408576698