tor-browser

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

webvr-disabled-by-feature-policy.https.sub.html (1127B)


      1 <!DOCTYPE html>
      2 <body>
      3  <script src=/resources/testharness.js></script>
      4  <script src=/resources/testharnessreport.js></script>
      5  <script src=/feature-policy/resources/featurepolicy.js></script>
      6 
      7  <script>
      8    'use strict';
      9    var same_origin_src = '/feature-policy/resources/feature-policy-webvr.html';
     10    var cross_origin_src = 'https://{{domains[www]}}:{{ports[https][0]}}' +
     11      same_origin_src;
     12    var header = 'Feature-Policy header vr "none"';
     13 
     14    promise_test(() => {
     15      return navigator.getVRDisplays().then(() => {
     16        assert_unreached('expected promise to reject');
     17      }, error => {
     18      });
     19    }, header + ' disallows the top-level document.');
     20 
     21    async_test(t => {
     22      test_feature_availability(
     23          'navigator.getVRDisplays()', t, same_origin_src,
     24          expect_feature_unavailable_default);
     25    }, header + ' disallows same-origin iframes.');
     26 
     27    async_test(t => {
     28      test_feature_availability(
     29          'navigator.getVRDisplays()', t, cross_origin_src,
     30          expect_feature_unavailable_default);
     31    }, header + ' disallows cross-origin iframes.');
     32  </script>
     33 </body>