tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

sxg-reporting-prefetch-parse_error.tentative.html (1467B)


      1 <!DOCTYPE html>
      2 <title>SXG reporting test of sxg.parse_error for prefetch</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 
     12 nel_test(async t => {
     13  await fetchResourceWithBasicPolicy();
     14  const sxg_url =
     15      alt_origin +
     16      '/signed-exchange/resources/sxg/sxg-invalid-format.sxg?prefetch';
     17  addPrefetch(sxg_url);
     18  assert_true(await reportsExist([
     19    {
     20      url: sxg_url,
     21      user_agent: navigator.userAgent,
     22      type: "network-error",
     23      body: {
     24        phase: "sxg",
     25        type: "sxg.parse_error",
     26        status_code: 200,
     27        referrer: location.origin + '/',
     28        sxg: {
     29          outer_url: sxg_url,
     30          cert_url: []
     31        }
     32      },
     33      metadata: {
     34        content_type: "application/reports+json",
     35      },
     36    },
     37    {
     38      url: sxg_url,
     39      user_agent: navigator.userAgent,
     40      type: "network-error",
     41      body: {
     42        phase: "application",
     43        type: "ok",
     44        status_code: 200,
     45        referrer: location.origin + '/',
     46      },
     47      metadata: {
     48        content_type: "application/reports+json",
     49      },
     50    },
     51  ]));
     52 }, 'SXG reporting test of sxg.parse_error for prefetch.');
     53 </script>
     54 </body>