tor-browser

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

protected-audience-surface-failure.https.html (2054B)


      1 <!doctype html>
      2 <meta name=timeout content=long>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="/common/utils.js"></script>
      6 <script src="resources/protected-audience-helper-module.js"></script>
      7 
      8 <body>
      9 <script>
     10 'use strict';
     11 
     12 promise_test(async test => {
     13  const uuid = generateUuid();
     14  const contribution = '{ bucket: 340282366920938463463374607431768211456n, value: 1 }';
     15 
     16  await runReportTest(test, uuid,
     17    { scoreAd:
     18    `try {
     19      privateAggregation.contributeToHistogram(${contribution});
     20    } catch {
     21      forDebuggingOnly.reportAdAuctionWin('${createWritingURL(uuid)}');
     22    }`},
     23    /*expectedNumReports=*/ 1);
     24 }, 'contributeToHistogram() with too large bucket in scoreAd()');
     25 
     26 promise_test(async test => {
     27  const uuid = generateUuid();
     28  const contribution = '{ bucket: -1n, value: 1 }';
     29 
     30  await runReportTest(test, uuid,
     31    { reportResult:
     32    `try {
     33      privateAggregation.contributeToHistogram(${contribution});
     34    } catch {
     35      sendReportTo('${createWritingURL(uuid)}');
     36    }`},
     37    /*expectedNumReports=*/ 1);
     38 }, 'contributeToHistogram() with negative bucket in reportResult()');
     39 
     40 
     41 promise_test(async test => {
     42  const uuid = generateUuid();
     43  const contribution = '{ bucket: 1, value: 1 }';
     44 
     45  await runReportTest(test, uuid,
     46    { generateBid:
     47    `try {
     48      privateAggregation.contributeToHistogram(${contribution});
     49    } catch {
     50      forDebuggingOnly.reportAdAuctionWin('${createWritingURL(uuid)}');
     51    }`},
     52    /*expectedNumReports=*/ 1);
     53 }, 'contributeToHistogram() with non-BigInt bucket in generateBid()');
     54 
     55 promise_test(async test => {
     56  const uuid = generateUuid();
     57  const contribution = '{ bucket: 1n, value: -1 }';
     58 
     59  await runReportTest(test, uuid,
     60    { reportWin:
     61    `try {
     62      privateAggregation.contributeToHistogram(${contribution});
     63    } catch {
     64      sendReportTo('${createWritingURL(uuid)}');
     65    }`},
     66    /*expectedNumReports=*/ 1);
     67 }, 'contributeToHistogram() with negative value in reportWin()');
     68 
     69 </script>
     70 </body>