| Index: third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-accepted.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-accepted.html b/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-accepted.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0c1f45c23cbfc3ac2078ec39de92eb320449e46e
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-accepted.html
|
| @@ -0,0 +1,31 @@
|
| +<!DOCTYPE html>
|
| +<script src="/resources/testharness.js"></script>
|
| +<script src="/resources/testharnessreport.js"></script>
|
| +<script src="/websocket/resources/get-request-header.js"></script>
|
| +<script src="/websocket/resources/cookie-test-util.js"></script>
|
| +<script>
|
| +if (window.testRunner) {
|
| + // Don't block third-party cookies.
|
| + testRunner.setBlockThirdPartyCookies(false);
|
| +}
|
| +
|
| +const origin = WS_REMOTE_ORIGIN;
|
| +
|
| +promise_test(t => {
|
| + return setCookie(origin).then(
|
| + () => {
|
| + return connectAndGetRequestHeadersFrom(origin);
|
| + }
|
| + ).then(
|
| + headers => {
|
| + const cookie = headers['cookie'];
|
| + assert_not_equals(cookie, undefined,
|
| + 'headers should contain a cookie header.');
|
| + // Same-site cookies are not included.
|
| + assert_equals(normalizeCookie(cookie), 'ws-path-root=1; ws=1');
|
| + return clear(origin);
|
| + }
|
| + );
|
| +}, "Test that third-party cookies are accepted for WebSockets when blocking " +
|
| + "is disabled.");
|
| +</script>
|
|
|