summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/semantics/interface-objects/004.html
blob: 2e4387ede3c5bf1e2f1fdc76a40a84d81fada85c (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!--
onconnect = function(e) {
  var unexpected = [
    // https://html.spec.whatwg.org/
    "DedicatedWorkerGlobalScope",
    "AbstractView",
    "AbstractWorker",
    "Location",
    "Navigator",
    "DOMImplementation",
    "Audio",
    "HTMLCanvasElement",
    "Path",
    "TextMetrics",
    "CanvasProxy",
    "CanvasRenderingContext2D",
    "DrawingStyle",
    "CanvasGradient",
    "CanvasPattern",
    "PopStateEvent",
    "HashChangeEvent",
    "PageTransitionEvent",
    // https://streams.spec.whatwg.org/
    "ReadableStreamDefaultReader",
    "ReadableStreamBYOBReader",
    "ReadableStreamDefaultController",
    "ReadableByteStreamController",
    "WritableStreamDefaultWriter",
    "WritableStreamDefaultController",
    // http://w3c.github.io/IndexedDB/
    "IDBEnvironment",
    // https://www.w3.org/TR/2010/NOTE-webdatabase-20101118/
    "Database",
    // https://w3c.github.io/uievents/
    "UIEvent",
    "FocusEvent",
    "MouseEvent",
    "WheelEvent",
    "InputEvent",
    "KeyboardEvent",
    "CompositionEvent",
  ];
  var result = [];
  for (var i = 0; i < unexpected.length; ++i) {
    result.push([unexpected[i], unexpected[i] in self]);
  }
  e.ports[0].postMessage(result);
}
/*
-->
<!doctype html>
<title>unavailable interface objects in shared worker</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
setup(function() {
  window.worker = new SharedWorker('#');
  worker.port.onmessage = function(e) {
    var result = e.data;
    for (var i = 0; i < result.length; ++i) {
      test(function() {
        assert_false(result[i][1]);
      }, "The " + result[i][0] + " interface object should not be exposed");
    }
    done();
  }
}, {explicit_done: true});
</script>
<!--
*/
//-->