tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_iframe_referrer_changing.html (1885B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Test iframe referrer policy attribute for Bug 1175736</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 iframe referrer attribute is honoured correctly
     11  * testing setAttribute and .referrer
     12  https://bugzilla.mozilla.org/show_bug.cgi?id=1175736
     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"];
     19 
     20  const testCases = [
     21    {ACTION: ["generate-iframe-changing-policy-test-set-attribute"],
     22      TESTS: [
     23        {ATTRIBUTE_POLICY: 'unsafe-url',
     24         NEW_ATTRIBUTE_POLICY: 'no-referrer',
     25         NAME: 'no-referrer-unsafe-url-with-origin-in-meta',
     26         META_POLICY: 'origin',
     27         DESC: "no-referrer (iframe, originally unsafe-url) with origin in meta",
     28         RESULT: 'none'},
     29        {ATTRIBUTE_POLICY: 'origin',
     30         NEW_ATTRIBUTE_POLICY: 'unsafe-url',
     31         NAME: 'unsafe-url-origin-with-no-referrer-in-meta',
     32         META_POLICY: 'no-referrer',
     33         DESC: "unsafe-url (iframe, originally origin) with no-referrer in meta",
     34         RESULT: 'full'}]},
     35    {ACTION: ["generate-iframe-changing-policy-test-property"],
     36      TESTS: [
     37        {ATTRIBUTE_POLICY: 'no-referrer',
     38         NEW_ATTRIBUTE_POLICY: 'unsafe-url',
     39         NAME: 'unsafe-url-no-referrer-with-origin-in-meta',
     40         META_POLICY: 'origin',
     41         DESC: "unsafe-url (iframe, originally no-referrer) with origin in meta",
     42         RESULT: 'full'}]}
     43  ];
     44  </script>
     45  <script type="application/javascript" src="/tests/dom/base/test/referrer_helper.js"></script>
     46 </head>
     47 <body onload="tests.next();">
     48  <iframe id="testframe"></iframe>
     49 </body>
     50 </html>