camera-potential-reporting.https.html (953B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script src='/resources/testharness.js'></script> 5 <script src='/resources/testharnessreport.js'></script> 6 </head> 7 <body> 8 <script> 9 var t = async_test("Camera Potential Report Format"); 10 11 var check_report_format = (reports, observer) => { 12 let report = reports[0]; 13 assert_equals(report.type, "potential-permissions-policy-violation"); 14 assert_equals(report.url, document.location.href); 15 assert_equals(report.body.featureId, "camera"); 16 assert_equals(report.body.disposition, "enforce"); 17 assert_equals(report.body.allowAttribute, "camera"); 18 assert_equals(report.body.srcAttribute, "/"); 19 }; 20 21 new ReportingObserver(t.step_func_done(check_report_format), 22 {types: ['potential-permissions-policy-violation']}).observe(); 23 24 const iframe = document.createElement('iframe'); 25 iframe.allow = "camera"; 26 iframe.src = "/"; 27 document.body.appendChild(iframe); 28 </script> 29 </body> 30 </html>