tor-browser

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

simple-trigger-aggregatable-debug-report.sub.https.html (1920B)


      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      trigger: {
     14        event_trigger_data: [{}],
     15        aggregatable_debug_reporting: {
     16          key_piece: '0x5',
     17          debug_data: [
     18            {
     19              types: ['trigger-no-matching-source'],
     20              key_piece: '0x40',
     21              value: 123
     22            }
     23          ]
     24        }
     25      },
     26    },
     27  ]));
     28 
     29  const payload = await pollAggregatableDebugReports();
     30  assert_equals(payload.reports.length, 1);
     31  const report = JSON.parse(payload.reports[0].body);
     32  assert_own_property(report, 'shared_info');
     33  const shared_info = JSON.parse(report.shared_info);
     34  assert_own_property(shared_info, 'api');
     35  assert_equals(shared_info.api, 'attribution-reporting-debug');
     36  assert_own_property(shared_info, 'report_id');
     37  assert_own_property(shared_info, 'reporting_origin');
     38  assert_own_property(shared_info, 'scheduled_report_time');
     39  assert_own_property(shared_info, 'version');
     40  assert_equals(shared_info.version, '1.0');
     41  assert_own_property(shared_info, 'attribution_destination');
     42  assert_equals(shared_info.attribution_destination, host);
     43  assert_not_own_property(shared_info, 'source_registration_time');
     44  assert_own_property(report, 'aggregation_service_payloads');
     45  assert_equals(report.aggregation_service_payloads.length, 1);
     46  const aggregation_service_payload = report.aggregation_service_payloads[0];
     47  assert_own_property(aggregation_service_payload, 'payload');
     48  assert_own_property(aggregation_service_payload, 'key_id');
     49 }, 'Aggregatable debug report is received.');
     50 </script>