https://github.com/web-platform-tests/wpt
Revision 570156428c6cda2f41c964720161dc236ce68e2e authored by Josh Matthews on 23 November 2018, 20:53:25 UTC, committed by GitHub on 23 November 2018, 20:53:25 UTC
1 parent 98224e6
Raw File
Tip revision: 570156428c6cda2f41c964720161dc236ce68e2e authored by Josh Matthews on 23 November 2018, 20:53:25 UTC
Set default for manifest_update flag appropriately.
Tip revision: 5701564
reports-are-not-observable.https.html
<!DOCTYPE HTML>
<html>
<head>
  <title>
    Test that NEL reports are not observable from JavaScript
  </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 => {
      // Register an observer for NEL reports.
      var observer = new ReportingObserver((reports, _) => {
        assert_unreached("NEL reports should not be observable");
      }, {"types": ["network-error"]});
      observer.observe();
      // Make a request to a resource whose response headers include a NEL
      // policy.  If NEL reports are observable, this will queue a task that
      // calls the observer function above (which we don't want).
      await fetchResourceWithBasicPolicy();
      // Wait for one second to give any observer callback task a chance to
      // fire.
      await new Promise(resolve => t.step_timeout(resolve, 1000 /* msec */));
    });
  </script>
</body>
</html>
back to top