summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/eventsource/shared-worker/eventsource-close.js
blob: 8d160b605f2b17ead47ed7191c04ad2b9aff0fe3 (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) {
    this.close()
    port.postMessage([true, this.readyState])
  }
} catch(e) {
  port.postMessage([false, String(e)])
}
}