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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/fetch/referrer/resources/origin-when-cross-origin-dedicated-worker-js.php

Issue 1844413006: Support ReferrerPolicy in Fetch API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update-referrer-policy
Patch Set: Created 4 years, 8 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/fetch/referrer/resources/origin-when-cross-origin-dedicated-worker-js.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/referrer/resources/origin-when-cross-origin-dedicated-worker-js.php b/third_party/WebKit/LayoutTests/http/tests/fetch/referrer/resources/origin-when-cross-origin-dedicated-worker-js.php
index 1908dda7df4af90738e0a067c669125502bad732..32d917894c86a7449f4dc7d5cfab2f66548a2db1 100644
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/referrer/resources/origin-when-cross-origin-dedicated-worker-js.php
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/referrer/resources/origin-when-cross-origin-dedicated-worker-js.php
@@ -6,17 +6,53 @@
importScripts('/fetch/resources/fetch-test-helpers.js');
-var BASE_URL = BASE_ORIGIN + '/fetch/resources/referrer.php';
-var OTHER_URL = OTHER_ORIGIN + '/fetch/resources/referrer.php';
-var REFERRER_SOURCE = location.href;
-
-var TESTS = [
- [BASE_URL, 'about:client', REFERRER_SOURCE],
- [BASE_URL, '', '[no-referrer]'],
- [BASE_URL, '/foo', BASE_ORIGIN + '/foo'],
- [OTHER_URL, 'about:client', BASE_ORIGIN + '/'],
- [OTHER_URL, '', '[no-referrer]'],
- [OTHER_URL, '/foo', BASE_ORIGIN + '/'],
+const BASE_URL = BASE_ORIGIN + '/fetch/resources/referrer.php';
+const OTHER_URL = OTHER_ORIGIN + '/fetch/resources/referrer.php';
+const REFERRER_SOURCE = location.href;
+
+test(function(t) {
+ assert_equals(new Request(BASE_URL).referrer, 'about:client');
+ }, 'Request referrer property should be immune to the page referrer policy');
+
+const TESTS = [
+ [BASE_URL, 'about:client', '', REFERRER_SOURCE],
+ [BASE_URL, 'about:client', 'no-referrer', '[no-referrer]'],
+ [BASE_URL, 'about:client', 'no-referrer-when-downgrade', REFERRER_SOURCE],
+ [BASE_URL, 'about:client', 'origin-only', BASE_ORIGIN + '/'],
+ [BASE_URL, 'about:client', 'origin-when-cross-origin', REFERRER_SOURCE],
+ [BASE_URL, 'about:client', 'unsafe-url', REFERRER_SOURCE],
+ [OTHER_URL, 'about:client', '', BASE_ORIGIN + '/'],
+ [OTHER_URL, 'about:client', 'no-referrer', '[no-referrer]'],
+ [OTHER_URL, 'about:client', 'no-referrer-when-downgrade', REFERRER_SOURCE],
+ [OTHER_URL, 'about:client', 'origin-only', BASE_ORIGIN + '/'],
+ [OTHER_URL, 'about:client', 'origin-when-cross-origin', BASE_ORIGIN + '/'],
+ [OTHER_URL, 'about:client', 'unsafe-url', REFERRER_SOURCE],
+
+ [BASE_URL, '', '', '[no-referrer]'],
+ [BASE_URL, '', 'no-referrer', '[no-referrer]'],
+ [BASE_URL, '', 'no-referrer-when-downgrade', '[no-referrer]'],
+ [BASE_URL, '', 'origin-only', '[no-referrer]'],
+ [BASE_URL, '', 'origin-when-cross-origin', '[no-referrer]'],
+ [BASE_URL, '', 'unsafe-url', '[no-referrer]'],
+ [OTHER_URL, '', '', '[no-referrer]'],
+ [OTHER_URL, '', 'no-referrer', '[no-referrer]'],
+ [OTHER_URL, '', 'no-referrer-when-downgrade', '[no-referrer]'],
+ [OTHER_URL, '', 'origin-only', '[no-referrer]'],
+ [OTHER_URL, '', 'origin-when-cross-origin', '[no-referrer]'],
+ [OTHER_URL, '', 'unsafe-url', '[no-referrer]'],
+
+ [BASE_URL, '/foo', '', BASE_ORIGIN + '/foo'],
+ [BASE_URL, '/foo', 'no-referrer', '[no-referrer]'],
+ [BASE_URL, '/foo', 'no-referrer-when-downgrade', BASE_ORIGIN + '/foo'],
+ [BASE_URL, '/foo', 'origin-only', BASE_ORIGIN + '/'],
+ [BASE_URL, '/foo', 'origin-when-cross-origin', BASE_ORIGIN + '/foo'],
+ [BASE_URL, '/foo', 'unsafe-url', BASE_ORIGIN + '/foo'],
+ [OTHER_URL, '/foo', '', BASE_ORIGIN + '/'],
+ [OTHER_URL, '/foo', 'no-referrer', '[no-referrer]'],
+ [OTHER_URL, '/foo', 'no-referrer-when-downgrade', BASE_ORIGIN + '/foo'],
+ [OTHER_URL, '/foo', 'origin-only', BASE_ORIGIN + '/'],
+ [OTHER_URL, '/foo', 'origin-when-cross-origin', BASE_ORIGIN + '/'],
+ [OTHER_URL, '/foo', 'unsafe-url', BASE_ORIGIN + '/foo'],
];
add_referrer_tests(TESTS);

Powered by Google App Engine
This is Rietveld 408576698