report-to-single-endpoint.https.sub.html (1227B)
1 <!DOCTYPE html> 2 <html> 3 <head> 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='../../mediacapture-streams/permission-helper.js'></script> 9 <script src='/reporting/resources/report-helper.js'></script> 10 </head> 11 <body> 12 <script> 13 const base_url = `${location.protocol}//${location.host}`; 14 const endpoint = `${base_url}/reporting/resources/report.py`; 15 const id = 'c898489f-00d2-40af-a480-4e8d9f907469'; 16 17 promise_test(async t => { 18 await setMediaPermission("granted", ["camera","microphone"]); 19 await promise_rejects_dom( 20 t, "NotAllowedError", navigator.mediaDevices.getUserMedia({video: true}), 21 "UserMedia camera access should not be allowed in this document."); 22 while(true) { 23 await wait(100); 24 const reports = await pollReports(endpoint, id); 25 if (reports.length) { 26 checkReportExists(reports, 'permissions-policy-violation', location.href); 27 break; 28 } 29 } 30 }, "Reporting-Endpoints defined endpoint received reports."); 31 </script> 32 </body> 33 </html>