123456789101112131415161718192021222324252627282930313233343536373839 |
- <!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="resources/helpers.js"></script>
- <script>
- attribution_reporting_promise_test(async t => {
- const cookie = 'ar_debug=1;Secure;HttpOnly;SameSite=None;Path=/';
- const source_debug_key = '246';
- const trigger_debug_key = '357';
- await registerAttributionSrc(t, {
- source: {
- destination: `https://{{host}}`,
- debug_key: source_debug_key,
- },
- cookie,
- });
- await registerAttributionSrc(t, {
- trigger: {
- event_trigger_data: [{trigger_data: '0'}],
- debug_key: trigger_debug_key,
- },
- cookie,
- });
- const payload = await pollEventLevelReports();
- assert_equals(payload.reports.length, 1);
- const report = JSON.parse(payload.reports[0].body);
- assert_equals(report.source_debug_key, source_debug_key);
- assert_equals(report.trigger_debug_key, trigger_debug_key);
- const debugPayload = await pollEventLevelDebugReports();
- assert_equals(debugPayload.reports.length, 1);
- const debugReport = JSON.parse(debugPayload.reports[0].body);
- assert_equals(debugReport.source_debug_key, source_debug_key);
- assert_equals(debugReport.trigger_debug_key, trigger_debug_key);
- }, 'Debug report is received if source and trigger debug keys are set.');
- </script>
|