summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/eventsource/shared-worker/eventsource-onopen.js
blob: 6dc9424a213d793e52e7e6788a849b6f08107488 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
onconnect = function(e) {
try {
  var port = e.ports[0]
  var source = new EventSource("../resources/message.py")
  source.onopen = function(e) {
    port.postMessage([true, source.readyState, 'data' in e, e.bubbles, e.cancelable])
    this.close()
  }
} catch(e) {
  port.postMessage([false, String(e)])
}
}