| Index: third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-blocked.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-blocked.html b/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-blocked.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6ade3c7a4e1d84abb68e69fbc240c4b1e23e7521
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-blocked.html
|
| @@ -0,0 +1,33 @@
|
| +<!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.setAlwaysAcceptCookies(false);
|
| +}
|
| +
|
| +const origin = WS_REMOTE_ORIGIN;
|
| +
|
| +async_test(t => {
|
| + setCookie(origin).then(
|
| + t.step_func(() => {
|
| + return connectAndGetRequestHeadersFrom(origin);
|
| + }),
|
| + t.unreached_func('Failed to set cookie.')
|
| + ).then(
|
| + t.step_func(headers => {
|
| + const cookie = headers['cookie'];
|
| + assert_equals(cookie, undefined,
|
| + 'headers should not contain any cookie header.');
|
| + return clear(origin);
|
| + }),
|
| + t.unreached_func('Cookie header lookup failed.')
|
| + ).then(
|
| + t.done.bind(t),
|
| + t.unreached_func('Failed to clear cookies.')
|
| + );
|
| +}, "Test third-party cookie blocking for WebSockets");
|
| +</script>
|
|
|