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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 2405483002: Make the request initiator Optional (Closed)
Patch Set: Introduce NullableOrigin to use for request initiator Created 4 years, 2 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: net/url_request/url_request_unittest.cc
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 345c7ca67d468f333413d8f7a59b4d6d17565beb..bbd500df50bc2873c42d9eeb62359ab363b5012d 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -2713,7 +2713,7 @@ TEST_F(URLRequestTest, SameSiteCookies) {
std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
req->set_first_party_for_cookies(test_server.GetURL(kHost, "/"));
- req->set_initiator(url::Origin(test_server.GetURL(kHost, "/")));
+ req->set_initiator(new url::NullableOrigin(test_server.GetURL(kHost, "/")));
req->Start();
base::RunLoop().Run();
@@ -2730,7 +2730,8 @@ TEST_F(URLRequestTest, SameSiteCookies) {
std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
req->set_first_party_for_cookies(test_server.GetURL(kSubHost, "/"));
- req->set_initiator(url::Origin(test_server.GetURL(kSubHost, "/")));
+ req->set_initiator(
+ new url::NullableOrigin(test_server.GetURL(kSubHost, "/")));
req->Start();
base::RunLoop().Run();
@@ -2747,7 +2748,8 @@ TEST_F(URLRequestTest, SameSiteCookies) {
std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
req->set_first_party_for_cookies(test_server.GetURL(kCrossHost, "/"));
- req->set_initiator(url::Origin(test_server.GetURL(kCrossHost, "/")));
+ req->set_initiator(
+ new url::NullableOrigin(test_server.GetURL(kCrossHost, "/")));
req->Start();
base::RunLoop().Run();
@@ -2765,7 +2767,8 @@ TEST_F(URLRequestTest, SameSiteCookies) {
std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
req->set_first_party_for_cookies(test_server.GetURL(kHost, "/"));
- req->set_initiator(url::Origin(test_server.GetURL(kCrossHost, "/")));
+ req->set_initiator(
+ new url::NullableOrigin(test_server.GetURL(kCrossHost, "/")));
req->set_method("GET");
req->Start();
base::RunLoop().Run();
@@ -2784,7 +2787,8 @@ TEST_F(URLRequestTest, SameSiteCookies) {
std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
req->set_first_party_for_cookies(test_server.GetURL(kHost, "/"));
- req->set_initiator(url::Origin(test_server.GetURL(kCrossHost, "/")));
+ req->set_initiator(
+ new url::NullableOrigin(test_server.GetURL(kCrossHost, "/")));
req->set_method("POST");
req->Start();
base::RunLoop().Run();

Powered by Google App Engine
This is Rietveld 408576698