https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 34bd5b1a3394e0ffcae29aae509057bfd1fa3935 authored by Yutaka Hirano on 03 April 2018, 03:15:14 UTC
fix
Tip revision: 34bd5b1
rejections.https.html
<!DOCTYPE html>
<title>Service Worker: Rejection Types</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>

(function() {
    var t = async_test('Rejections are DOMExceptions');
    t.step(function() {

        navigator.serviceWorker.register('http://example.com').then(
            t.step_func(function() { assert_unreached('Registration should fail'); }),
            t.step_func(function(reason) {
                assert_true(reason instanceof DOMException);
                assert_true(reason instanceof Error);
                t.done();
            }));
    });
}());

</script>
back to top