https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 4325cea5626c2861fc9e94897c1a0a7754cf6998 authored by Yutaka Hirano on 23 April 2018, 06:10:53 UTC
fix
Tip revision: 4325cea
callback-exception.html
<!doctype html>
<meta charset=utf-8>
<title>requestIdleCallback callback exception reported to error handler</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id="log"></div>
<script>
  var custom_exception = 'requestIdleCallbackException';
  setup({allow_uncaught_exception : true});
  async_test(function (t) {
    assert_false(document.hidden, "document.hidden must exist and be false to run this test properly");
    addEventListener("error",function(e) {
      t.step(function() {
        assert_equals(e.error.message, custom_exception);
        t.done();
      })
    });
    window.requestIdleCallback(function () {
      throw new Error(custom_exception);
    });
  }, "requestIdleCallback callback exceptions are reported to error handler");
</script>
back to top