payment-reporting.https.html (1288B)
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/permissions-policy-report-json.js'></script> 7 </head> 8 <body> 9 <script> 10 var t = async_test("PaymentRequest Report Format"); 11 12 var check_report_format = (reports, observer) => { 13 let report = reports[0]; 14 assert_equals(report.type, "permissions-policy-violation"); 15 assert_equals(report.url, document.location.href); 16 assert_equals(report.body.featureId, "payment"); 17 assert_equals(report.body.sourceFile, document.location.href); 18 assert_equals(typeof report.body.lineNumber, "number"); 19 assert_equals(typeof report.body.columnNumber, "number"); 20 assert_equals(report.body.disposition, "enforce"); 21 check_report_json(report); 22 }; 23 24 new ReportingObserver(t.step_func_done(check_report_format), 25 {types: ['permissions-policy-violation']}).observe(); 26 27 t.step_func(() => { 28 assert_throws_dom('SecurityError', 29 () => new PaymentRequest( 30 [{ supportedMethods: 'https://example.com/pay' }], 31 { total: { label: 'Total', amount: { currency: 'USD', value: 0 }}}, 32 {}).show(), 33 "PaymentRequest API should not be allowed in this document."); 34 })(); 35 </script> 36 </body> 37 </html>