| Index: third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-blocking.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-blocking.html b/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-blocking.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6a20a5a6dd893256c49bbcfbeb1f3886012a1a58
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-blocking.html
|
| @@ -0,0 +1,33 @@
|
| +<!DOCTYPE html>
|
| +<script src="/js-test-resources/testharness.js"></script>
|
| +<script src="/js-test-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);
|
| +}
|
| +
|
| +var test = async_test('Test third-party cookie blocking for WebSocket');
|
| +
|
| +test.step(() => {
|
| + setCookie(CROSS_ORIGIN_WS_SERVER).then(
|
| + test.step_func(() => {
|
| + return connectAndGetRequestHeadersFrom(CROSS_ORIGIN_WS_SERVER);
|
| + }),
|
| + test.unreached_func('Failed to set cookie.')
|
| + ).then(
|
| + test.step_func(headers => {
|
| + const cookie = headers['cookie'];
|
| + assert_equals(cookie, undefined,
|
| + 'headers should not contain a cookie header.');
|
| + return clear(CROSS_ORIGIN_WS_SERVER);
|
| + }),
|
| + test.unreached_func('cookie header lookup failed.')
|
| + ).then(
|
| + test.done.bind(test),
|
| + test.unreached_func('Failed to clear cookies.')
|
| + );
|
| +});
|
| +</script>
|
|
|