https://github.com/web-platform-tests/wpt
Revision 259d0612af038d14f2cd889a14a3adb6c9e96d96 authored by Josh Matthews on 23 December 2018, 05:25:51 UTC, committed by Josh Matthews on 26 December 2018, 14:25:28 UTC
1 parent cd31531
Raw File
Tip revision: 259d0612af038d14f2cd889a14a3adb6c9e96d96 authored by Josh Matthews on 23 December 2018, 05:25:51 UTC
Claim to support testdriver in servodriver
Tip revision: 259d061
no-report-on-failed-cors-preflight.https.html
<!DOCTYPE HTML>
<html>
<head>
  <title>
    Test that NEL reports are not sent if the CORS preflight fails
  </title>
  <script src='/resources/testharness.js'></script>
  <script src='/resources/testharnessreport.js'></script>
  <script src='./support/nel.sub.js'></script>
</head>
<body>
  <script>
    nel_test(async t => {
      // Make a request to a resource whose response headers include a NEL
      // policy, but where the report uploader will reject the CORS preflight.
      await fetchResourceWithBasicPolicy('www2');
      // Because the CORS preflight is rejected, we should never receive a
      // report about the request.
      assert_false(await reportExists({
        url: getURLForResourceWithBasicPolicy('www2'),
        type: "network-error",
      }));
    });
  </script>
</body>
</html>
back to top