aggregatable-report-no-contributions.sub.https.html (1747B)
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 const expectedSourceEventId = generateSourceEventId(); 12 const expectedSourceDebugKey = '456'; 13 const expectedTriggerDebugKey = '654'; 14 15 registerAttributionSrcByImg(createRedirectChain([ 16 { 17 source: { 18 aggregation_keys: { 19 campaignCounts: '0x159', 20 }, 21 debug_key: expectedSourceDebugKey, 22 destination: host, 23 source_event_id: expectedSourceEventId, 24 }, 25 }, 26 { 27 trigger : { 28 aggregatable_values: { 29 geoValue: 32768, 30 }, 31 debug_key: expectedTriggerDebugKey, 32 debug_reporting: true, 33 }, 34 }, 35 ])); 36 37 const debugPayload = await pollVerboseDebugReports(); 38 assert_equals(debugPayload.reports.length, 1); 39 const debugReport = JSON.parse(debugPayload.reports[0].body); 40 assert_equals(debugReport.length, 1); 41 assert_equals(debugReport[0].type, 'trigger-aggregate-no-contributions'); 42 assert_own_property(debugReport[0], 'body'); 43 const debugReportBody = debugReport[0].body; 44 assert_equals(debugReportBody.attribution_destination, host); 45 assert_equals(debugReportBody.source_event_id, expectedSourceEventId); 46 assert_equals(debugReportBody.source_site, host); 47 assert_equals(debugReportBody.source_debug_key, expectedSourceDebugKey); 48 assert_equals(debugReportBody.trigger_debug_key, expectedTriggerDebugKey); 49 }, 'Aggregatable report is not created due to no contributions.'); 50 </script>