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

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

Issue 12328079: Update TestURLRequest constructor interface in extensions unit tests. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebase onto master. Created 7 years, 9 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: 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 ddc55416f222dc3997714bab5401e9226b4ab3eb..69c53f012d46d916c43a07f39d85c6f10ab88d6e 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc
@@ -73,7 +73,7 @@ TEST(WebRequestConditionTest, CreateCondition) {
net::TestURLRequestContext context;
const GURL http_url("http://www.example.com");
- net::TestURLRequest match_request(http_url, NULL, &context);
+ net::TestURLRequest match_request(http_url, NULL, &context, NULL);
WebRequestData data(&match_request, ON_BEFORE_REQUEST);
WebRequestDataWithMatchIds request_data(&data);
request_data.url_match_ids = matcher.MatchURL(http_url);
@@ -83,7 +83,7 @@ TEST(WebRequestConditionTest, CreateCondition) {
EXPECT_TRUE(result->IsFulfilled(request_data));
const GURL https_url("https://www.example.com");
- net::TestURLRequest wrong_resource_type(https_url, NULL, &context);
+ net::TestURLRequest wrong_resource_type(https_url, NULL, &context, NULL);
data.request = &wrong_resource_type;
request_data.url_match_ids = matcher.MatchURL(http_url);
// Make sure IsFulfilled does not fail because of URL matching.
@@ -119,7 +119,7 @@ TEST(WebRequestConditionTest, CreateConditionFirstPartyForCookies) {
net::TestURLRequestContext context;
const GURL http_url("http://www.example.com");
const GURL first_party_url("http://fpfc.example.com");
- net::TestURLRequest match_request(http_url, NULL, &context);
+ net::TestURLRequest match_request(http_url, NULL, &context, NULL);
WebRequestData data(&match_request, ON_BEFORE_REQUEST);
WebRequestDataWithMatchIds request_data(&data);
request_data.url_match_ids = matcher.MatchURL(http_url);
@@ -187,7 +187,7 @@ TEST(WebRequestConditionTest, NoUrlAttributes) {
net::TestURLRequestContext context;
net::TestURLRequest https_request(
- GURL("https://www.example.com"), NULL, &context);
+ GURL("https://www.example.com"), NULL, &context, NULL);
// 1. A non-empty condition without UrlFilter attributes is fulfilled iff its
// attributes are fulfilled.
@@ -247,7 +247,7 @@ TEST(WebRequestConditionTest, CreateConditionSet) {
// https://www.example.com
GURL http_url("http://www.example.com");
net::TestURLRequestContext context;
- net::TestURLRequest http_request(http_url, NULL, &context);
+ net::TestURLRequest http_request(http_url, NULL, &context, NULL);
WebRequestData data(&http_request, ON_BEFORE_REQUEST);
WebRequestDataWithMatchIds request_data(&data);
request_data.url_match_ids = matcher.MatchURL(http_url);
@@ -258,7 +258,7 @@ TEST(WebRequestConditionTest, CreateConditionSet) {
GURL https_url("https://www.example.com");
request_data.url_match_ids = matcher.MatchURL(https_url);
EXPECT_EQ(1u, request_data.url_match_ids.size());
- net::TestURLRequest https_request(https_url, NULL, &context);
+ net::TestURLRequest https_request(https_url, NULL, &context, NULL);
data.request = &https_request;
EXPECT_TRUE(result->IsFulfilled(*(request_data.url_match_ids.begin()),
request_data));
@@ -267,7 +267,7 @@ TEST(WebRequestConditionTest, CreateConditionSet) {
GURL https_foo_url("https://foo.example.com");
request_data.url_match_ids = matcher.MatchURL(https_foo_url);
EXPECT_EQ(0u, request_data.url_match_ids.size());
- net::TestURLRequest https_foo_request(https_foo_url, NULL, &context);
+ net::TestURLRequest https_foo_request(https_foo_url, NULL, &context, NULL);
data.request = &https_foo_request;
EXPECT_FALSE(result->IsFulfilled(-1, request_data));
}
@@ -306,22 +306,22 @@ TEST(WebRequestConditionTest, TestPortFilter) {
// Test various URLs.
GURL http_url("http://www.example.com");
net::TestURLRequestContext context;
- net::TestURLRequest http_request(http_url, NULL, &context);
+ net::TestURLRequest http_request(http_url, NULL, &context, NULL);
url_match_ids = matcher.MatchURL(http_url);
ASSERT_EQ(1u, url_match_ids.size());
GURL http_url_80("http://www.example.com:80");
- net::TestURLRequest http_request_80(http_url_80, NULL, &context);
+ net::TestURLRequest http_request_80(http_url_80, NULL, &context, NULL);
url_match_ids = matcher.MatchURL(http_url_80);
ASSERT_EQ(1u, url_match_ids.size());
GURL http_url_1000("http://www.example.com:1000");
- net::TestURLRequest http_request_1000(http_url_1000, NULL, &context);
+ net::TestURLRequest http_request_1000(http_url_1000, NULL, &context, NULL);
url_match_ids = matcher.MatchURL(http_url_1000);
ASSERT_EQ(1u, url_match_ids.size());
GURL http_url_2000("http://www.example.com:2000");
- net::TestURLRequest http_request_2000(http_url_2000, NULL, &context);
+ net::TestURLRequest http_request_2000(http_url_2000, NULL, &context, NULL);
url_match_ids = matcher.MatchURL(http_url_2000);
ASSERT_EQ(0u, url_match_ids.size());
}

Powered by Google App Engine
This is Rietveld 408576698