summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-close.js
blob: 875c9098bac380f122d075143d239da63bb33b31 (plain)
1
2
3
4
5
6
7
8
9
try {
  var source = new EventSource("../resources/message.py")
  source.onopen = function(e) {
    this.close()
    postMessage([true, this.readyState])
  }
} catch(e) {
  postMessage([false, String(e)])
}