summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/service-worker/rejections.https.html
blob: 8002ad9a81b962756cd7b9921e0cfe974c808340 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!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>