tor-browser

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

shared-storage-surface-success.https.html (2047B)


      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: 1n, value: 2}]
     20  };
     21 
     22  await VerifyContributeToHistogram(paa_data, /*expected_error=*/false);
     23 }, 'basic contributeToHistogram() test');
     24 
     25 promise_test(async () => {
     26  const paa_data = {
     27    enableDebugMode: true,
     28    contributions: [{bucket: 0n, value: 2}]
     29  };
     30 
     31  await VerifyContributeToHistogram(paa_data, /*expected_error=*/false);
     32 }, 'contributeToHistogram() with a zero bucket');
     33 
     34 promise_test(async () => {
     35  const paa_data = {
     36    enableDebugMode: true,
     37    contributions: [{bucket: 1n, value: 0}]
     38  };
     39 
     40  await VerifyContributeToHistogram(paa_data, /*expected_error=*/false);
     41 }, 'contributeToHistogram() with a zero value');
     42 
     43 promise_test(async () => {
     44  const paa_data = {
     45    enableDebugMode: true,
     46    contributions: [{bucket: 18446744073709551616n, value: 5}]
     47  };
     48 
     49  await VerifyContributeToHistogram(paa_data, /*expected_error=*/false);
     50 }, 'contributeToHistogram() with a large bucket');
     51 
     52 promise_test(async () => {
     53  const paa_data = {
     54    enableDebugMode: true,
     55    contributions: [{bucket: 340282366920938463463374607431768211455n, value: 5}]
     56  };
     57 
     58  await VerifyContributeToHistogram(paa_data, /*expected_error=*/false);
     59 }, 'contributeToHistogram() with a max bucket');
     60 
     61 promise_test(async () => {
     62  const paa_data = {
     63    enableDebugMode: true,
     64    contributions: [{bucket: 1n, value: 2.3}]
     65  };
     66 
     67  await VerifyContributeToHistogram(paa_data, /*expected_error=*/false);
     68 }, 'contributeToHistogram() with a non-integer value');
     69 
     70 </script>
     71 </body>