summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/SharedWorker-simple.html
blob: 7cd3f4f3be65112f9a9c247b860727817156f6c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE html>
<title>Test simple shared worker construction case.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(t => {
    let worker;

    return new Promise(resolve => {
        worker = new SharedWorker('support/SharedWorker-common.js', 'name');
        worker.port.postMessage("ping");
        worker.port.onmessage = resolve;
    }).then(e => {
        assert_equals(e.data, "PASS: Received ping message");
    });
});
</script>