[Pkg-javascript-commits] [sockjs-client] 275/434: More stable streaming test (first chunk can be smaller than 2049)

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:19 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 8ac0d6dfa5c8b8e04423190485f75dec4704e6bd
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Tue Jan 10 14:45:18 2012 +0000

    More stable streaming test (first chunk can be smaller than 2049)
---
 tests/html/src/domtests.coffee | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/tests/html/src/domtests.coffee b/tests/html/src/domtests.coffee
index 18eee93..4559822 100644
--- a/tests/html/src/domtests.coffee
+++ b/tests/html/src/domtests.coffee
@@ -100,16 +100,14 @@ ajax_simple_factory = (name) ->
 
 ajax_streaming_factory = (name) ->
     asyncTest name + ' streaming', ->
-        expect(3)
+        expect(4)
         x = new u[name]('GET', '/streaming.txt', null)
-        chunkno = 0
         x.onchunk = (status, text) ->
-            switch chunkno
-                when 0
-                    equal(text.length, 2049)
-                    equal(text.slice(-2), 'a\n')
-            chunkno += 1
+            equal(status, 200)
+            ok(text.length <= 2049)
+            delete x.onchunk
         x.onfinish = (status, text) ->
+            equal(status, 200)
             equal(text.slice(-4), 'a\nb\n')
             start()
 

-- 
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