sxg-referrer-same-physical-same-logical.tentative.https.html (1838B)
1 <!DOCTYPE html> 2 <title>Referrer of SignedHTTPExchange(physical:same origin, logical:same origin)</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/common/get-host-info.sub.js"></script> 6 <script src="./resources/sxg-util.js"></script> 7 <body> 8 <script> 9 (() => { 10 const SAME_ORIGIN = get_host_info().HTTPS_ORIGIN; 11 const SAME_ORIGIN_SXG = 'sxg-referrer-same-origin.sxg'; 12 const TEST_CASES = [ 13 // Physical origin = same origin. Logical origin = same origin. 14 { 15 origin: SAME_ORIGIN, 16 sxg: SAME_ORIGIN_SXG, 17 referrerPolicy: undefined, 18 expectedReferrer: document.location.href 19 }, 20 { 21 origin: SAME_ORIGIN, 22 sxg: SAME_ORIGIN_SXG, 23 referrerPolicy: 'no-referrer', 24 expectedReferrer: '' 25 }, 26 { 27 origin: SAME_ORIGIN, 28 sxg: SAME_ORIGIN_SXG, 29 referrerPolicy: 'no-referrer-when-downgrade', 30 expectedReferrer: document.location.href 31 }, 32 { 33 origin: SAME_ORIGIN, 34 sxg: SAME_ORIGIN_SXG, 35 referrerPolicy: 'origin', 36 expectedReferrer: document.location.origin + '/' 37 }, 38 { 39 origin: SAME_ORIGIN, 40 sxg: SAME_ORIGIN_SXG, 41 referrerPolicy: 'same-origin', 42 expectedReferrer: document.location.href 43 }, 44 { 45 origin: SAME_ORIGIN, 46 sxg: SAME_ORIGIN_SXG, 47 referrerPolicy: 'strict-origin', 48 expectedReferrer: document.location.origin + '/' 49 }, 50 { 51 origin: SAME_ORIGIN, 52 sxg: SAME_ORIGIN_SXG, 53 referrerPolicy: 'strict-origin-when-cross-origin', 54 expectedReferrer: document.location.href 55 }, 56 { 57 origin: SAME_ORIGIN, 58 sxg: SAME_ORIGIN_SXG, 59 referrerPolicy: 'unsafe-url', 60 expectedReferrer: document.location.href 61 }, 62 ]; 63 runReferrerTests(TEST_CASES); 64 })(); 65 </script> 66 </body>