2 <title>SXG reporting test of sxg.failed downgraded from sxg.cert_fetch_error 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>
10 const alt_origin
= get_host_info().HTTPS_NOTSAMESITE_ORIGIN
;
11 const test_origin
= get_host_info().HTTPS_ORIGIN
;
14 await
fetchResourceWithBasicPolicy();
16 alt_origin
+ '/signed-exchange/resources/sxg/sxg-cert-not-found.sxg?navigation';
17 const cert_url
= test_origin
+ '/signed-exchange/resources/not_found_certfile.cbor';
18 const message
= await
openSXGInIframeAndWaitForMessage(t
, sxg_url
);
19 assert_equals(message
.location
,
20 innerURLOrigin() + '/signed-exchange/resources/inner-url.html');
21 assert_true(message
.is_fallback
);
22 assert_true(await
reportsExist([
25 user_agent
: navigator
.userAgent
,
26 type
: "network-error",
29 // The origin of this SXG's certURL is different from the reporting
30 // origin. So the report must be downgraded.
34 referrer
: location
.href
,
38 innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
43 content_type
: "application/reports+json",
48 user_agent
: navigator
.userAgent
,
49 type
: "network-error",
54 referrer
: location
.href
,
57 content_type
: "application/reports+json",
61 }, 'SXG reporting test of sxg.failed downgraded from sxg.cert_fetch_error for' +