<!doctype html>
<meta charset=utf-8>
<meta name=timeout content=long>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/attribution-reporting/resources/helpers.js"></script>
<script>
attribution_reporting_promise_test(async t => {
const host = 'https://{{host}}';
const expectedSourceEventId = generateSourceEventId();
registerAttributionSrcByImg(createRedirectChain([
{
cookie: attributionDebugCookie,
source: {
destination: host,
filter_data: {a: ['b']},
source_event_id: expectedSourceEventId,
},
},
{
trigger: {
debug_reporting: true,
event_trigger_data: [{}],
filters: {a: ['c']},
},
},
]));
const payload = await pollVerboseDebugReports();
assert_equals(payload.reports.length, 1);
const report = JSON.parse(payload.reports[0].body);
assert_equals(report.length, 1);
assert_equals(report[0].type, 'trigger-no-matching-filter-data');
assert_own_property(report[0], 'body');
const reportBody = report[0].body;
assert_equals(reportBody.attribution_destination, host);
assert_equals(reportBody.source_event_id, expectedSourceEventId);
assert_equals(reportBody.source_site, host);
assert_not_own_property(reportBody, 'source_debug_key');
assert_not_own_property(reportBody, 'trigger_debug_key');
}, 'Verbose debug report is received due to no matching filter data');
</script>