chromium/third_party/blink/web_tests/wpt_internal/attribution-reporting/trigger-registration.sub.https.html

<!doctype html>
<meta charset=utf-8>
<meta name=timeout content=long>
<meta name=variant content="?method=fetch">
<meta name=variant content='?method=fetch&eligible={"triggerEligible":true,"eventSourceEligible":false}'>
<meta name=variant content="?method=img">
<meta name=variant content="?method=img&eligible">
<meta name=variant content="?method=script">
<meta name=variant content="?method=script&eligible">
<meta name=variant content="?method=xhr">
<meta name=variant content='?method=xhr&eligible={"triggerEligible":true,"eventSourceEligible":false}'>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/attribution-reporting/resources/helpers.js"></script>
<body>
<script>
attribution_reporting_promise_test(async t => {
  const source = {
    debug_reporting: true,
    destination: 'https://{{host}}',
    source_event_id: generateSourceEventId(),
  };
  registerAttributionSrc({
    cookie: attributionDebugCookie,
    source
  });
  await waitForSourceToBeRegistered(source.source_event_id);
  registerAttributionSrc({
    trigger: {
      event_trigger_data: [{}],
    },
    method: 'variant',
  });

  const payload = await pollEventLevelReports();
  assert_equals(payload.reports.length, 1);

  const report = JSON.parse(payload.reports[0].body);
  assert_equals(report.trigger_data, '0');
}, 'Trigger registration succeeds.');
</script>