| 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());
|
|
|
|
|