document-reporting-default-endpoint.https.sub.html (1230B)
1 <!DOCTYPE HTML> 2 <meta charset=utf-8> 3 <title>Test that document level reports are sent to default endpoint</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="/resources/testdriver.js"></script> 7 <script src="/resources/testdriver-vendor.js"></script> 8 <script src='resources/report-helper.js'></script> 9 <p id="error">No error</p> 10 <script> 11 async_test(function (test) { 12 var observer = new ReportingObserver(function (reports) { 13 test.step(function () { 14 assert_equals(reports.length, 1); 15 assert_equals(reports[0].type, "deprecation"); 16 }); 17 test.done(); 18 }); 19 observer.observe(); 20 }, "report generated"); 21 </script> 22 <script>webkitRequestAnimationFrame(() => {});</script> 23 <script> 24 const base_url = `${location.protocol}//${location.host}`; 25 const endpoint = `${base_url}/reporting/resources/report.py`; 26 const id = '46ecac28-6d27-4763-a692-bcc588054716'; 27 promise_test(async t => { 28 await wait(3000); 29 const reports = await pollReports(endpoint, id); 30 checkReportExists(reports, 'deprecation', location.href); 31 }, "Reporting-Endpoints defined endpoint received reports."); 32 </script> 33 </body> 34 35 </html>