tor-browser

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

header-parsing-error-debug-report.sub.https.html (1141B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <meta name=timeout content=long>
      4 <script src="/common/get-host-info.sub.js"></script>
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script src="/attribution-reporting/resources/helpers.js"></script>
      8 <script>
      9 attribution_reporting_promise_test(async t => {
     10  registerAttributionSrc({
     11    trigger: {
     12      event_trigger_data: {},
     13    },
     14    extraHeaders: [
     15      {
     16        name: 'Attribution-Reporting-Info',
     17        value: 'report-header-errors',
     18      },
     19    ],
     20    method: 'img',
     21  });
     22 
     23  const payload = await pollVerboseDebugReports();
     24  assert_equals(payload.reports.length, 1);
     25  const report = JSON.parse(payload.reports[0].body);
     26  assert_equals(report.length, 1);
     27  assert_equals(report[0].type, 'header-parsing-error');
     28  assert_own_property(report[0], 'body');
     29  assert_equals(report[0].body.context_site, 'https://{{host}}');
     30  assert_equals(report[0].body.header, 'Attribution-Reporting-Register-Trigger');
     31  assert_equals(report[0].body.value, '{"event_trigger_data":{}}');
     32 }, 'Header error debug report is received.');
     33 </script>