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

Unified Diff: net/websockets/websocket_stream_cookie_test.cc

Issue 2102993002: Fix WebSocket to set first party for cookies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update testRunner calls to setBlockThirdPartyCookies() Created 4 years, 5 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
« no previous file with comments | « net/websockets/websocket_stream.cc ('k') | net/websockets/websocket_stream_create_test_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_stream_cookie_test.cc
diff --git a/net/websockets/websocket_stream_cookie_test.cc b/net/websockets/websocket_stream_cookie_test.cc
index c3ae3a9afe00a09b43d71026a8e31cfcf04b6616..585e03d16811bfb63036843ec8606adc1464653a 100644
--- a/net/websockets/websocket_stream_cookie_test.cc
+++ b/net/websockets/websocket_stream_cookie_test.cc
@@ -32,6 +32,7 @@ class TestBase : public WebSocketStreamCreateTestBase {
public:
void CreateAndConnect(const GURL& url,
const url::Origin& origin,
+ const GURL& first_party_for_cookies,
const std::string& cookie_header,
const std::string& response_body) {
// We assume cookie_header ends with CRLF if not empty, as
@@ -45,7 +46,8 @@ class TestBase : public WebSocketStreamCreateTestBase {
cookie_header, std::string(),
std::string()),
response_body);
- CreateAndConnectStream(url.spec(), NoSubProtocols(), origin, "", nullptr);
+ CreateAndConnectStream(url, NoSubProtocols(), origin,
+ first_party_for_cookies, "", nullptr);
}
std::string AddCRLFIfNotEmpty(const std::string& s) {
@@ -128,6 +130,7 @@ TEST_P(WebSocketStreamClientUseCookieTest, ClientUseCookie) {
const GURL url(GetParam().url);
const GURL cookie_url(GetParam().cookie_url);
const url::Origin origin(GURL("http://www.example.com"));
+ const GURL first_party_for_cookies("http://www.example.com/");
const std::string cookie_line(GetParam().cookie_line);
const std::string cookie_header(AddCRLFIfNotEmpty(GetParam().cookie_header));
@@ -146,7 +149,8 @@ TEST_P(WebSocketStreamClientUseCookieTest, ClientUseCookie) {
ASSERT_TRUE(is_called);
ASSERT_TRUE(set_cookie_result);
- CreateAndConnect(url, origin, cookie_header, WebSocketStandardResponse(""));
+ CreateAndConnect(url, origin, first_party_for_cookies, cookie_header,
+ WebSocketStandardResponse(""));
WaitUntilConnectDone();
EXPECT_FALSE(has_failed());
}
@@ -158,6 +162,7 @@ TEST_P(WebSocketStreamServerSetCookieTest, ServerSetCookie) {
const GURL url(GetParam().url);
const GURL cookie_url(GetParam().cookie_url);
const url::Origin origin(GURL("http://www.example.com"));
+ const GURL first_party_for_cookies("http://www.example.com/");
const std::string cookie_line(GetParam().cookie_line);
const std::string cookie_header(AddCRLFIfNotEmpty(GetParam().cookie_header));
@@ -173,7 +178,7 @@ TEST_P(WebSocketStreamServerSetCookieTest, ServerSetCookie) {
CookieStore* store =
url_request_context_host_.GetURLRequestContext()->cookie_store();
- CreateAndConnect(url, origin, "", response);
+ CreateAndConnect(url, origin, first_party_for_cookies, "", response);
WaitUntilConnectDone();
EXPECT_FALSE(has_failed());
« no previous file with comments | « net/websockets/websocket_stream.cc ('k') | net/websockets/websocket_stream_create_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698