sxg-reporting-navigation-invalid_integrity_header.tentative.html (1976B)
1 <!DOCTYPE html> 2 <title>SXG reporting test of sxg.invalid_integrity_header for navigation</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/common/get-host-info.sub.js"></script> 6 <script src="/network-error-logging/support/nel.sub.js"></script> 7 <script src="../resources/sxg-util.js"></script> 8 <body> 9 <script> 10 const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN; 11 const test_origin = get_host_info().HTTPS_ORIGIN; 12 13 nel_iframe_test(async t => { 14 await loadResourceWithBasicPolicyInIframe(); 15 const sxg_url = 16 alt_origin + 17 '/signed-exchange/resources/sxg/sxg-invalid-integrity-header.sxg?navigation'; 18 const cert_url = test_origin + '/signed-exchange/resources/127.0.0.1.sxg.pem.cbor'; 19 const message = await openSXGInIframeAndWaitForMessage(t, sxg_url); 20 assert_equals(message.location, 21 innerURLOrigin() + '/signed-exchange/resources/inner-url.html'); 22 assert_true(message.is_fallback); 23 assert_true(await reportsExist([ 24 { 25 url: sxg_url, 26 user_agent: navigator.userAgent, 27 type: "network-error", 28 body: { 29 phase: "sxg", 30 type: "sxg.invalid_integrity_header", 31 status_code: 200, 32 referrer: location.origin + '/', 33 sxg: { 34 outer_url: sxg_url, 35 inner_url: 36 innerURLOrigin() + '/signed-exchange/resources/inner-url.html', 37 cert_url: [cert_url] 38 } 39 }, 40 metadata: { 41 content_type: "application/reports+json", 42 }, 43 }, 44 { 45 url: sxg_url, 46 user_agent: navigator.userAgent, 47 type: "network-error", 48 body: { 49 phase: "application", 50 type: "ok", 51 status_code: 200, 52 referrer: location.origin + '/', 53 }, 54 metadata: { 55 content_type: "application/reports+json", 56 }, 57 }, 58 ])); 59 }, 'SXG reporting test of sxg.invalid_integrity_header for navigation.'); 60 </script> 61 </body>