tor-browser

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

shared-storage-surface-failure.https.html (2129B)


      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 // Note: This file should contain at most 6 shared storage subtests due to the
     14 // budget on selectURL().
     15 
     16 promise_test(async () => {
     17  const paa_data = {
     18    enableDebugMode: true,
     19    contributions: [{bucket: 340282366920938463463374607431768211456n, value: 2}]
     20  };
     21 
     22  await VerifyContributeToHistogram(paa_data, /*expected_error=*/true);
     23 }, 'contributeToHistogram() with a bucket too large');
     24 
     25 promise_test(async () => {
     26  const paa_data = {
     27    enableDebugMode: true,
     28    contributions: [{bucket: -1n, value: 2}]
     29  };
     30 
     31  await VerifyContributeToHistogram(paa_data, /*expected_error=*/true);
     32 }, 'contributeToHistogram() with negative bucket');
     33 
     34 promise_test(async () => {
     35  const paa_data = {
     36    enableDebugMode: true,
     37    contributions: [{bucket: 1, value: 2}]
     38  };
     39 
     40  await VerifyContributeToHistogram(paa_data, /*expected_error=*/true);
     41 }, 'contributeToHistogram() with non-BigInt bucket');
     42 
     43 promise_test(async () => {
     44  const paa_data = {
     45    enableDebugMode: true,
     46    enableDebugModeArgs: 1234n,
     47    contributions: [{bucket: 1n, value: 2}]
     48  };
     49 
     50  await VerifyContributeToHistogram(paa_data, /*expected_error=*/true);
     51 }, 'Invalid enableDebugMode argument');
     52 
     53 promise_test(async () => {
     54  const paa_data = {
     55    enableDebugMode: true,
     56    enableDebugModeArgs: {debugKey: 1234},
     57    contributions: [{bucket: 1n, value: 2}]
     58  };
     59 
     60  await VerifyContributeToHistogram(paa_data, /*expected_error=*/true);
     61 }, 'contributeToHistogram() with a non-BigInt debugKey');
     62 
     63 promise_test(async () => {
     64  const paa_data = {
     65    enableDebugMode: true,
     66    enableDebugModeExtraTime: true,
     67    contributions: [{bucket: 1n, value: 2}]
     68  };
     69 
     70  await VerifyContributeToHistogram(paa_data, /*expected_error=*/true);
     71 }, 'enableDebugMode called twice');
     72 
     73 </script>
     74 </body>