tor-browser

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

simple-source-aggregatable-debug-report.sub.https.html (1941B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <meta name=timeout content=long>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/attribution-reporting/resources/helpers.js"></script>
      7 <script>
      8 attribution_reporting_promise_test(async t => {
      9  const host = 'https://{{host}}';
     10 
     11  registerAttributionSrcByImg(createRedirectChain([
     12    {
     13      source: {
     14        destination: host,
     15        aggregatable_debug_reporting: {
     16          budget: 1024,
     17          key_piece: '0x5',
     18          debug_data: [
     19            {
     20              types: ['source-success', 'source-noised'],
     21              key_piece: '0x40',
     22              value: 123
     23            }
     24          ]
     25        }
     26      },
     27    },
     28  ]));
     29 
     30  const payload = await pollAggregatableDebugReports();
     31  assert_equals(payload.reports.length, 1);
     32  const report = JSON.parse(payload.reports[0].body);
     33  assert_own_property(report, 'shared_info');
     34  const shared_info = JSON.parse(report.shared_info);
     35  assert_own_property(shared_info, 'api');
     36  assert_equals(shared_info.api, 'attribution-reporting-debug');
     37  assert_own_property(shared_info, 'report_id');
     38  assert_own_property(shared_info, 'reporting_origin');
     39  assert_own_property(shared_info, 'scheduled_report_time');
     40  assert_own_property(shared_info, 'version');
     41  assert_equals(shared_info.version, '1.0');
     42  assert_own_property(shared_info, 'attribution_destination');
     43  assert_equals(shared_info.attribution_destination, host);
     44  assert_not_own_property(shared_info, 'source_registration_time');
     45  assert_own_property(report, 'aggregation_service_payloads');
     46  assert_equals(report.aggregation_service_payloads.length, 1);
     47  const aggregation_service_payload = report.aggregation_service_payloads[0];
     48  assert_own_property(aggregation_service_payload, 'payload');
     49  assert_own_property(aggregation_service_payload, 'key_id');
     50 }, 'Aggregatable debug report is received.');
     51 </script>