tor-browser

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

feature-policy-nested-header-policy-allowed-for-self.https.sub.html (3366B)


      1 <!DOCTYPE html>
      2 <meta name="timeout" content="long">
      3 <body>
      4  <script src=/resources/testharness.js></script>
      5  <script src=/resources/testharnessreport.js></script>
      6  <script src=/feature-policy/resources/featurepolicy.js></script>
      7  <script>
      8  /*
      9  fullscreen is allowed for 'self' at the top-level document and through the
     10  chain of same-origin iframes. It can be enabled by subframes, but otherwise
     11  is disallowed everywhere else.
     12  */
     13  'use strict';
     14  const same_origin = 'https://{{domains[]}}:{{ports[https][0]}}';
     15  const cross_origin = 'https://{{domains[www]}}:{{ports[https][0]}}';
     16  const same_origin_src = '/feature-policy/resources/feature-policy-nested-subframe-policy.https.sub.html';
     17  const cross_origin_src = cross_origin + same_origin_src;
     18 
     19  /* ------------------------------------------
     20     |  top-level document                    |
     21     |  ------------------------------------  |
     22     |  |  same-origin iframe              |  |
     23     |  |  ------------------------------  |  |
     24     |  |  |  local and remote iframes  |  |  |
     25     |  |  ------------------------------  |  |
     26     |  ------------------------------------  |
     27     ------------------------------------------ */
     28  test_subframe_header_policy('fullscreen', '*', same_origin_src,
     29      {local_all: true, local_self: true, local_none: false,
     30      remote_all: false, remote_self: false, remote_none: false},
     31      'Test nested header policy with local iframe on policy "fullscreen *"');
     32  test_subframe_header_policy('fullscreen', '\'self\'', same_origin_src,
     33      {local_all: true, local_self: true, local_none: false,
     34      remote_all: false, remote_self: false, remote_none: false},
     35      'Test nested header policy with local iframe on policy "fullscreen \'self\'"');
     36  test_subframe_header_policy('fullscreen', '\'none\'', same_origin_src,
     37      {local_all: false, local_self: false, local_none: false,
     38      remote_all: false, remote_self: false, remote_none: false},
     39      'Test nested header policy with local iframe on policy "fullscreen \'none\'"');
     40 
     41  /* -------------------------------------------
     42     |  top-level document                     |
     43     |  -------------------------------------  |
     44     |  |  cross-origin iframe              |  |
     45     |  |  -------------------------------  |  |
     46     |  |  |  local and remote iframes   |  |  |
     47     |  |  -------------------------------  |  |
     48     |  -------------------------------------  |
     49     ------------------------------------------- */
     50  test_subframe_header_policy('fullscreen', '*', cross_origin_src,
     51      {local_all: false, local_self: false, local_none: false,
     52      remote_all: false, remote_self: false, remote_none: false},
     53      'Test nested header policy with remote iframe on policy "fullscreen *"');
     54  test_subframe_header_policy('fullscreen', '\'self\'', cross_origin_src,
     55      {local_all: false, local_self: false, local_none: false,
     56      remote_all: false, remote_self: false, remote_none: false},
     57      'Test nested header policy with remote iframe on policy "fullscreen \'self\'"');
     58  test_subframe_header_policy('fullscreen', '\'none\'', cross_origin_src,
     59      {local_all: false, local_self: false, local_none: false,
     60      remote_all: false, remote_self: false, remote_none: false},
     61      'Test nested header policy with remote iframe on policy "fullscreen \'none\'"');
     62  </script>
     63 </body>