summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/content-security-policy/blink-contrib/worker-importscripts-blocked.sub.html
blob: 9ec49c03025e65dca189f36d8fb99ee64ba30f89 (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
<!DOCTYPE html>
<html>

<head>
    <!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
    <title>worker-importscripts-blocked</title>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script src='../support/logTest.sub.js?logs=["TEST COMPLETE"]'></script>
    <script src="../support/alertAssert.sub.js?alerts=[]"></script>
    <!-- enforcing policy:
script-src 'self' 'unsafe-inline' 'unsafe-eval' 'unsafe-inline' 127.0.0.1:8000; connect-src 'self';
-->
    <script></script>
</head>

<body>
    <script>
        window.wasPostTestScriptParsed = true;
        var result = '';
        try {
            var worker = new Worker('http://{{host}}:{{ports[http][0]}}/content-security-policy/blink-contrib/resources/worker-importscripts.js');
            worker.onmessage = function(event) {
                result = event.data;
                test(function() {
                    assert_equals(result, 'importScripts blocked')
                });
                log("TEST COMPLETE");
            };
        } catch (e) {
            result = e;
            test(function() {
                assert_equals(result, 'importScripts blocked')
            });
            log("TEST COMPLETE");
        }

    </script>
    <div id="log"></div>
    <script async defer src="../support/checkReport.sub.js?reportExists=false"></script>
</body>

</html>