Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-blocking.html

Issue 2102993002: Fix WebSocket to set first party for cookies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698