[Pkg-javascript-commits] [sockjs-client] 229/350: Fix url for echo from child test. Relax streaming test to allow any size chunk.
tonnerre at ancient-solutions.com
tonnerre at ancient-solutions.com
Fri Aug 5 01:04:24 UTC 2016
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.
commit 854c279cbb50cbb5f5ab08691ed7363dc9556f2c
Author: Bryce Kahle <bkahle at gmail.com>
Date: Thu Oct 23 16:48:24 2014 -0400
Fix url for echo from child test. Relax streaming test to allow any size chunk.
---
tests/lib/iframe.js | 13 ++++++++++++-
tests/lib/senders.js | 6 ++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/tests/lib/iframe.js b/tests/lib/iframe.js
index 53de566..fc9ac20 100644
--- a/tests/lib/iframe.js
+++ b/tests/lib/iframe.js
@@ -105,11 +105,22 @@ describe('Transports', function () {
transportList.forEach(function (Trans) {
describe(Trans.transportName, function () {
if (!Trans.enabled({ cookie_needed: false, nullOrigin: false, sameScheme: true, sameOrigin: true })) {
+ it('[unsupported]');
return;
}
var transport = Trans.transportName;
- echoTests.echoFromChild(transport);
+ var soUrl = testUtils.getSameOriginUrl();
+ describe('same origin', function () {
+ echoTests.echoFromChild(soUrl, transport);
+ });
+
+ // var corsUrl = testUtils.getCrossOriginUrl();
+ // if (corsUrl && corsUrl !== soUrl) {
+ // describe('cross origin', function () {
+ // echoTests.echoFromChild(corsUrl, transport);
+ // });
+ // }
});
});
});
diff --git a/tests/lib/senders.js b/tests/lib/senders.js
index 6a0fb40..9dc2621 100644
--- a/tests/lib/senders.js
+++ b/tests/lib/senders.js
@@ -20,13 +20,15 @@ function ajaxSimple (Obj) {
function ajaxStreaming (Obj) {
it('streaming', function (done) {
var x = new Obj('GET', testUtils.getSameOriginUrl() + '/streaming.txt', null);
+ var i = 0;
x.on('chunk', function (status, text) {
expect(status).to.equal(200);
+ i++;
// 2051 because of transparent proxies
- expect([2049, 2051]).to.contain(text.length);
- x.removeAllListeners('chunk');
+ //expect([2049, 2051]).to.contain(text.length);
});
x.on('finish', function (status, text) {
+ expect(i).to.be.greaterThan(0);
expect(status).to.equal(200);
expect(text.slice(-4)).to.equal('a\nb\n');
done();
--
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