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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/fetch/referrer/no-referrer-document.html

Issue 1844413006: Support ReferrerPolicy in Fetch API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update-referrer-policy
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/fetch/referrer/origin-only-document.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <meta http-equiv = "Content-Security-Policy" content = "referrer no-referrer"> 3 <meta http-equiv = "Content-Security-Policy" content = "referrer no-referrer">
4 <title>Fetch in a document with &quot;referrer no-referrer&quot; policy</title> 4 <title>Fetch in a document with &quot;referrer no-referrer&quot; policy</title>
5 <body> 5 <body>
6 <script src = "/resources/testharness.js"></script> 6 <script src = "/resources/testharness.js"></script>
7 <script src = "/resources/testharness-helpers.js"></script> 7 <script src = "/resources/testharness-helpers.js"></script>
8 <script src = "/resources/testharnessreport.js"></script> 8 <script src = "/resources/testharnessreport.js"></script>
9 <script src = "/serviceworker/resources/test-helpers.js"></script> 9 <script src = "/serviceworker/resources/test-helpers.js"></script>
10 <script src = "/fetch/resources/fetch-test-options.js"></script> 10 <script src = "/fetch/resources/fetch-test-options.js"></script>
11 <script src = "/fetch/resources/fetch-test-helpers.js"></script> 11 <script src = "/fetch/resources/fetch-test-helpers.js"></script>
12 <script> 12 <script>
13 13
14 var BASE_URL = BASE_ORIGIN + '/fetch/resources/referrer.php'; 14 const BASE_URL = BASE_ORIGIN + '/fetch/resources/referrer.php';
15 var OTHER_URL = OTHER_ORIGIN + '/fetch/resources/referrer.php'; 15 const OTHER_URL = OTHER_ORIGIN + '/fetch/resources/referrer.php';
16 const REFERRER_SOURCE = location.href;
16 17
17 test(function(t) { 18 test(function(t) {
18 assert_equals(new Request(BASE_URL).referrer, 'about:client'); 19 assert_equals(new Request(BASE_URL).referrer, 'about:client');
19 }, 'Request referrer property should be immune to the page referrer policy'); 20 }, 'Request referrer property should be immune to the page referrer policy');
20 21
21 var TESTS = [ 22 const TESTS = [
22 [BASE_URL, 'about:client', '[no-referrer]'], 23 [BASE_URL, 'about:client', '', '[no-referrer]'],
23 [BASE_URL, '', '[no-referrer]'], 24 [BASE_URL, 'about:client', 'no-referrer', '[no-referrer]'],
24 [BASE_URL, '/foo', '[no-referrer]'], 25 [BASE_URL, 'about:client', 'no-referrer-when-downgrade', REFERRER_SOURCE],
25 [OTHER_URL, 'about:client', '[no-referrer]'], 26 [BASE_URL, 'about:client', 'origin', BASE_ORIGIN + '/'],
26 [OTHER_URL, '', '[no-referrer]'], 27 [BASE_URL, 'about:client', 'origin-when-cross-origin', REFERRER_SOURCE],
27 [OTHER_URL, '/foo', '[no-referrer]'], 28 [BASE_URL, 'about:client', 'unsafe-url', REFERRER_SOURCE],
29 [OTHER_URL, 'about:client', '', '[no-referrer]'],
30 [OTHER_URL, 'about:client', 'no-referrer', '[no-referrer]'],
31 [OTHER_URL, 'about:client', 'no-referrer-when-downgrade', REFERRER_SOURCE],
32 [OTHER_URL, 'about:client', 'origin', BASE_ORIGIN + '/'],
33 [OTHER_URL, 'about:client', 'origin-when-cross-origin', BASE_ORIGIN + '/'],
34 [OTHER_URL, 'about:client', 'unsafe-url', REFERRER_SOURCE],
35
36 [BASE_URL, '', '', '[no-referrer]'],
37 [BASE_URL, '', 'no-referrer', '[no-referrer]'],
38 [BASE_URL, '', 'no-referrer-when-downgrade', '[no-referrer]'],
39 [BASE_URL, '', 'origin', '[no-referrer]'],
40 [BASE_URL, '', 'origin-when-cross-origin', '[no-referrer]'],
41 [BASE_URL, '', 'unsafe-url', '[no-referrer]'],
42 [OTHER_URL, '', '', '[no-referrer]'],
43 [OTHER_URL, '', 'no-referrer', '[no-referrer]'],
44 [OTHER_URL, '', 'no-referrer-when-downgrade', '[no-referrer]'],
45 [OTHER_URL, '', 'origin', '[no-referrer]'],
46 [OTHER_URL, '', 'origin-when-cross-origin', '[no-referrer]'],
47 [OTHER_URL, '', 'unsafe-url', '[no-referrer]'],
48
49 [BASE_URL, '/foo', '', '[no-referrer]'],
50 [BASE_URL, '/foo', 'no-referrer', '[no-referrer]'],
51 [BASE_URL, '/foo', 'no-referrer-when-downgrade', BASE_ORIGIN + '/foo'],
52 [BASE_URL, '/foo', 'origin', BASE_ORIGIN + '/'],
53 [BASE_URL, '/foo', 'origin-when-cross-origin', BASE_ORIGIN + '/foo'],
54 [BASE_URL, '/foo', 'unsafe-url', BASE_ORIGIN + '/foo'],
55 [OTHER_URL, '/foo', '', '[no-referrer]'],
56 [OTHER_URL, '/foo', 'no-referrer', '[no-referrer]'],
57 [OTHER_URL, '/foo', 'no-referrer-when-downgrade', BASE_ORIGIN + '/foo'],
58 [OTHER_URL, '/foo', 'origin', BASE_ORIGIN + '/'],
59 [OTHER_URL, '/foo', 'origin-when-cross-origin', BASE_ORIGIN + '/'],
60 [OTHER_URL, '/foo', 'unsafe-url', BASE_ORIGIN + '/foo'],
28 ]; 61 ];
29 62
30 add_referrer_tests(TESTS); 63 add_referrer_tests(TESTS);
31 done(); 64 done();
32 </script> 65 </script>
33 </body> 66 </body>
34 </html> 67 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/fetch/referrer/origin-only-document.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698