tor-browser

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

private-aggregation-permissions-policy-self.https.sub.html (1526B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="/common/utils.js"></script>
      5 <script src="/shared-storage/resources/util.js"></script>
      6 <script src="/private-aggregation/resources/util.js"></script>
      7 <script src="/fenced-frame/resources/utils.js"></script>
      8 
      9 <body>
     10 <script>
     11 'use strict';
     12 
     13 const paa_data = {
     14  enableDebugMode: true,
     15  contributions: [{bucket: 1n, value: 2}]
     16 };
     17 
     18 const cross_origin = 'https://{{domains[www]}}:{{ports[https][0]}}';
     19 
     20 promise_test(async () => {
     21  await VerifyContributeToHistogram(paa_data);
     22 }, 'In a page with "private-aggregation=(self)" permissions policy, ' +
     23   'initialize the worklet via sharedStorage.worklet.addModule(), and then ' +
     24   'execute contributeToHistogram() inside the worklet');
     25 
     26 promise_test(async () => {
     27  await CreateWorkletAndVerifyContributeToHistogram(
     28      /*shared_storage_origin=*/'', paa_data);
     29 }, 'In a page with "private-aggregation=(self)" permissions policy, ' +
     30   'createWorklet() with same-origin script, and then execute ' +
     31   'contributeToHistogram() inside the worklet');
     32 
     33 promise_test(async () => {
     34  await CreateWorkletAndVerifyContributeToHistogram(
     35      /*shared_storage_origin=*/cross_origin, paa_data, /*expected_error=*/true);
     36 }, 'In a page with "private-aggregation=(self)" permissions policy, ' +
     37   'createWorklet() with cross-origin script and script data origin, and then '
     38   + 'execute contributeToHistogram() inside the worklet');
     39 
     40 </script>
     41 </body>