summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/workers/worker-domurl.html
blob: 7a1d3355071a325fed8fce493f16e43008a2dbe3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html>
<body>
<pre id='console'></pre>

<script>
function log(message)
{
    document.getElementById('console').appendChild(document.createTextNode(message + "\n"));
}

function runTest() {
    var worker = new Worker('resources/worker-domurl.js');
    worker.onmessage = function(event) {
        if (event.data == 'DONE') {
            testDOMURL();
            if (window.testRunner)
                testRunner.notifyDone();
        } else
            log(event.data);
    }
    testDOMURL();
    worker.postMessage('');
}

function testDOMURL() 
{
    if (window.URL.createObjectURL == undefined)
        log('FAIL: window.URL.createObjectURL undefined');
    else
        log('PASS: window.URL.createObjectURL defined');

    if (window.URL.revokeObjectURL == undefined)
        log('FAIL: window.URL.revokeObjectURL undefined');
    else
        log('PASS: window.URL.revokeObjectURL defined');
}

if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}
window.onload = runTest;
</script>
</body>
</html>