geolocation-reporting.https.html (1012B)
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("Geolocation Report Format"); 10 11 var check_report_format = (reports, observer) => { 12 let report = reports[0]; 13 assert_equals(report.type, "permissions-policy-violation"); 14 assert_equals(report.url, document.location.href); 15 assert_equals(report.body.featureId, "geolocation"); 16 assert_equals(report.body.sourceFile, document.location.href); 17 assert_equals(typeof report.body.lineNumber, "number"); 18 assert_equals(typeof report.body.columnNumber, "number"); 19 assert_equals(report.body.disposition, "enforce"); 20 }; 21 22 new ReportingObserver(t.step_func_done(check_report_format), 23 {types: ['permissions-policy-violation']}).observe(); 24 25 navigator.geolocation.getCurrentPosition( 26 t.unreached_func("geolocation should be disabled in this document"), 27 () => {}); 28 </script> 29 </body> 30 </html>