Index: chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc |
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc |
index 02c75ec105fcdb14c32c089c210221e9d860d3de..8fe17c325760b698bf1094e93457ffb6aa435601 100644 |
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc |
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc |
@@ -68,12 +68,14 @@ TEST(WebRequestConditionTest, CreateCondition) { |
EXPECT_EQ("", error); |
ASSERT_TRUE(result.get()); |
- TestURLRequest match_request(GURL("http://www.example.com"), NULL); |
+ TestURLRequestContext context; |
+ TestURLRequest match_request(GURL("http://www.example.com"), NULL, &context); |
content::ResourceRequestInfo::AllocateForTesting(&match_request, |
ResourceType::MAIN_FRAME, NULL); |
EXPECT_TRUE(result->IsFulfilled(&match_request, ON_BEFORE_REQUEST)); |
- TestURLRequest wrong_resource_type(GURL("https://www.example.com"), NULL); |
+ TestURLRequest wrong_resource_type( |
+ GURL("https://www.example.com"), NULL, &context); |
content::ResourceRequestInfo::AllocateForTesting(&wrong_resource_type, |
ResourceType::SUB_FRAME, NULL); |
EXPECT_FALSE(result->IsFulfilled(&wrong_resource_type, ON_BEFORE_REQUEST)); |
@@ -135,7 +137,8 @@ TEST(WebRequestConditionTest, CreateConditionSet) { |
// Test that the result is correct and matches http://www.example.com and |
// https://www.example.com |
GURL http_url("http://www.example.com"); |
- TestURLRequest http_request(http_url, NULL); |
+ TestURLRequestContext context; |
+ TestURLRequest http_request(http_url, NULL, &context); |
url_match_ids = matcher.MatchURL(http_url); |
for (std::set<URLMatcherConditionSet::ID>::iterator i = url_match_ids.begin(); |
i != url_match_ids.end(); ++i) { |
@@ -146,7 +149,7 @@ TEST(WebRequestConditionTest, CreateConditionSet) { |
GURL https_url("https://www.example.com"); |
url_match_ids = matcher.MatchURL(https_url); |
- TestURLRequest https_request(https_url, NULL); |
+ TestURLRequest https_request(https_url, NULL, &context); |
number_matches = 0; |
for (std::set<URLMatcherConditionSet::ID>::iterator i = url_match_ids.begin(); |
i != url_match_ids.end(); ++i) { |
@@ -158,7 +161,7 @@ TEST(WebRequestConditionTest, CreateConditionSet) { |
// Check that both, hostPrefix and hostSuffix are evaluated. |
GURL https_foo_url("https://foo.example.com"); |
url_match_ids = matcher.MatchURL(https_foo_url); |
- TestURLRequest https_foo_request(https_foo_url, NULL); |
+ TestURLRequest https_foo_request(https_foo_url, NULL, &context); |
number_matches = 0; |
for (std::set<URLMatcherConditionSet::ID>::iterator i = url_match_ids.begin(); |
i != url_match_ids.end(); ++i) { |
@@ -213,22 +216,23 @@ TEST(WebRequestConditionTest, TestPortFilter) { |
// Test various URLs. |
GURL http_url("http://www.example.com"); |
- TestURLRequest http_request(http_url, NULL); |
+ TestURLRequestContext context; |
+ TestURLRequest http_request(http_url, NULL, &context); |
url_match_ids = matcher.MatchURL(http_url); |
ASSERT_EQ(1u, url_match_ids.size()); |
GURL http_url_80("http://www.example.com:80"); |
- TestURLRequest http_request_80(http_url_80, NULL); |
+ TestURLRequest http_request_80(http_url_80, NULL, &context); |
url_match_ids = matcher.MatchURL(http_url_80); |
ASSERT_EQ(1u, url_match_ids.size()); |
GURL http_url_1000("http://www.example.com:1000"); |
- TestURLRequest http_request_1000(http_url_1000, NULL); |
+ TestURLRequest http_request_1000(http_url_1000, NULL, &context); |
url_match_ids = matcher.MatchURL(http_url_1000); |
ASSERT_EQ(1u, url_match_ids.size()); |
GURL http_url_2000("http://www.example.com:2000"); |
- TestURLRequest http_request_2000(http_url_2000, NULL); |
+ TestURLRequest http_request_2000(http_url_2000, NULL, &context); |
url_match_ids = matcher.MatchURL(http_url_2000); |
ASSERT_EQ(0u, url_match_ids.size()); |
} |