[Pkg-javascript-commits] [sockjs-client] 401/434: Test for #61
Tonnerre Lombard
tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:28 UTC 2014
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch master
in repository sockjs-client.
commit c22bed0afefa9547616ed096d71031264902d468
Author: Marek Majkowski <majek04 at gmail.com>
Date: Tue Apr 24 14:01:25 2012 +0100
Test for #61
---
tests/html/src/endtoendtests.coffee | 14 ++++++++++++++
tests/html/src/tests.coffee | 3 ++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/tests/html/src/endtoendtests.coffee b/tests/html/src/endtoendtests.coffee
index 01b8d86..91211a1 100644
--- a/tests/html/src/endtoendtests.coffee
+++ b/tests/html/src/endtoendtests.coffee
@@ -118,3 +118,17 @@ asyncTest "close on close", ->
u.delay 10, ->
start()
+
+# Test for #61
+asyncTest "EventEmitter exception handling", ->
+ expect(1)
+ r = newSockJS('/echo', 'xhr-streaming')
+ prev_onerror = window.onerror
+ window.onerror = (e) ->
+ ok(/onopen error/.test(''+e))
+ window.onerror = prev_onerror
+ r.close()
+ r.onopen = (e) ->
+ throw "onopen error"
+ r.onclose = ->
+ start()
diff --git a/tests/html/src/tests.coffee b/tests/html/src/tests.coffee
index b99d6c7..90ef2db 100644
--- a/tests/html/src/tests.coffee
+++ b/tests/html/src/tests.coffee
@@ -11,7 +11,8 @@ protocols = ['websocket',
newSockJS = (path, protocol) ->
url = if /^http/.test(path) then path else client_opts.url + path
options = jQuery.extend({}, client_opts.sockjs_opts)
- options.protocols_whitelist = [protocol]
+ if protocol
+ options.protocols_whitelist = [protocol]
return new SockJS(url, null, options)
echo_factory_factory = (protocol, messages) ->
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git
More information about the Pkg-javascript-commits
mailing list