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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-blocking-in-iframe.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-in-iframe.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-blocking-in-iframe.html b/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-blocking-in-iframe.html
new file mode 100644
index 0000000000000000000000000000000000000000..c41f6170279f137709d11aedf0774afc9cb7bd9f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie-blocking-in-iframe.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<script src="/js-test-resources/testharness.js"></script>
+<script src="/js-test-resources/testharnessreport.js"></script>
+<script>
+if (window.testRunner) {
+ // Block third-party cookies.
+ testRunner.setAlwaysAcceptCookies(false);
+}
+var test = async_test('Test that third-party cookies are blocked for ' +
+ 'WebSocket when the document on which the WebSocket is instantiated ' +
+ 'is same domain but the top frame is not same domain');
+
+test.step(() => {
+ window.addEventListener(
+ 'message',
+ test.step_func_done(event => {
+ assert_equals(event.data, 'DONE');
+ }),
+ false);
+});
+</script>
+<!-- Using localhost so that it'll be the same domain as the WebSocket created
+in the iframe. -->
+<iframe src="http://localhost:8000/security/cookies/websocket/resources/third-party-iframe.html"></iframe>

Powered by Google App Engine
This is Rietveld 408576698