test_anchor_area_referrer_rel.html (1783B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Test anchor and area policy attribute for Bug 1174913</title> 6 <script src="/tests/SimpleTest/SimpleTest.js"></script> 7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 8 9 <!-- 10 Testing that anchor and area referrer attributes are honoured correctly 11 * anchor tag with referrer attribute with rel=noreferrer 12 https://bugzilla.mozilla.org/show_bug.cgi?id=1174913 13 --> 14 15 <script type="application/javascript"> 16 17 const SJS = "://example.com/tests/dom/base/test/referrer_testserver.sjs?"; 18 const PARAMS = ["ATTRIBUTE_POLICY", "NEW_ATTRIBUTE_POLICY", "META_POLICY", "REL"]; 19 20 const testCases = [ 21 {ACTION: ["generate-anchor-policy-test", "generate-area-policy-test"], 22 TESTS: [ 23 // setting rel=noreferrer -> we expect no referrer 24 {ATTRIBUTE_POLICY: 'unsafe-url', 25 NAME: 'unsafe-url-with-origin-in-meta-rel', 26 META_POLICY: 'origin', 27 DESC: "unsafe-url (anchor) with origin in meta and rel=noreferrer", 28 RESULT: 'none', 29 REL: 'noreferrer'}, 30 {ATTRIBUTE_POLICY: 'origin', 31 NAME: 'origin-with-unsafe-url-in-meta-rel', 32 META_POLICY: 'unsafe-url', 33 DESC: "origin (anchor) with unsafe-url in meta and rel=noreferrer", 34 RESULT: 'none', 35 REL: 'noreferrer'}, 36 {ATTRIBUTE_POLICY: 'origin', 37 NAME: 'origin-with-no-meta-rel', 38 META_POLICY: '', 39 DESC: "origin (anchor) with no meta and rel=noreferrer", 40 RESULT: 'none', 41 REL: 'noreferrer'}]} 42 ]; 43 </script> 44 <script type="application/javascript" src="/tests/dom/base/test/referrer_helper.js"></script> 45 </head> 46 <body onload="tests.next();"> 47 <iframe id="testframe"></iframe> 48 </body> 49 </html>