summaryrefslogtreecommitdiffstats
path: root/test/wpt/tests/xhr/resources/xmlhttprequest-timeout-runner.js
blob: 151226a94fb2687821ab96c58c15997ba80c2ffc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function testResultCallbackHandler(event) {
    if (event.data == "done") {
        done();
        return;
    }
    if (event.data.type == "is") {
        test(function() { assert_equals(event.data.got, event.data.expected); }, "Timeout test: " + event.data.msg);
        return;
    }
    if (event.data.type == "ok") {
        test(function() { assert_true(event.data.bool); }, "Timeout test: " + event.data.msg);
        return;
    }
}

window.addEventListener("message", testResultCallbackHandler);

// Setting up testharness.js
setup({ explicit_done: true });