| Index: third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/first-party-cookie-accepted.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/first-party-cookie-accepted.html b/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/first-party-cookie-accepted.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d060b65a5d25d22c22a1699599476fcb6f66bcd1
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/first-party-cookie-accepted.html
|
| @@ -0,0 +1,32 @@
|
| +<!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) {
|
| + // Block third-party cookies.
|
| + testRunner.setBlockThirdPartyCookies(true);
|
| +}
|
| +
|
| +const origin = WS_ORIGIN;
|
| +
|
| +promise_test(() => {
|
| + return setCookie(origin).then(
|
| + () => {
|
| + return connectAndGetRequestHeadersFrom(origin);
|
| + }
|
| + ).then(
|
| + headers => {
|
| + const cookie = headers['cookie'];
|
| + assert_not_equals(cookie, undefined,
|
| + 'headers should contain a cookie header.');
|
| + assert_equals(
|
| + normalizeCookie(cookie),
|
| + 'same-site-lax=1; same-site-strict=1; ws-domain-local-ip=1; ' +
|
| + 'ws-path-root=1; ws=1');
|
| + return clear(origin);
|
| + }
|
| + );
|
| +}, "Test that first-party cookies not blocked for WebSockets.");
|
| +</script>
|
|
|