tor-browser

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

default-enabled-features-attribute-change.https.html (1760B)


      1 <!DOCTYPE html>
      2 <title>Test changing the allow="" attribute after a navigation</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="/common/utils.js"></script>
      6 <script src="/common/dispatcher/dispatcher.js"></script>
      7 <script src="resources/utils.js"></script>
      8 <script src="/common/get-host-info.sub.js"></script>
      9 <script src="resources/default-enabled-features-helper.js"></script>
     10 
     11 <body>
     12 <script>
     13 promise_test(async(t) => {
     14  const fencedframe = await attachFencedFrameContext({
     15        generator_api: 'fledge',
     16        attributes: [["allow", "attribution-reporting *"]],
     17        origin: get_host_info().ORIGIN});
     18 
     19  fencedframe.element.allow = "attribution-reporting 'none'";
     20 
     21  await fencedframe.execute(async () => {
     22    assert_true(document.featurePolicy.allowsFeature('attribution-reporting'),
     23        "Changing the allow attribute should do nothing for this navigation.");
     24  }, []);
     25 }, 'Changing the allow attribute is a no-op for the current navigation');
     26 
     27 promise_test(async(t) => {
     28  const fencedframe = await attachFencedFrameContext({
     29        generator_api: 'fledge',
     30        attributes: [["allow", "attribution-reporting *"]],
     31        origin: get_host_info().ORIGIN});
     32 
     33  fencedframe.element.allow = "attribution-reporting 'none'";
     34 
     35  await fencedframe.execute(async () => {
     36    window.executor.suspend(() => {
     37      location.reload();
     38    });
     39  }, []);
     40 
     41  await fencedframe.execute(async () => {
     42    assert_true(document.featurePolicy.allowsFeature('attribution-reporting'),
     43          "Changing the allow attribute should do nothing on frame refresh.");
     44  }, []);
     45 
     46 }, 'Changing the allow attribute is a no-op for frame-initiated navigations');
     47 
     48 </script>
     49 </body>
     50 </html>