Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 12 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,20 @@ node_js:
- '4'
- '6'
- '8'
- node
git:
depth: 1
notifications:
irc: "irc.freenode.org#socket.io"
irc: irc.freenode.org#socket.io
matrix:
include:
- node_js: 'node'
env: BROWSER_NAME=chrome BROWSER_VERSION=latest
- node_js: 'node'
env: BROWSER_NAME=safari BROWSER_VERSION=latest
- node_js: 'node'
env: BROWSER_NAME=firefox BROWSER_VERSION=latest
- node_js: 'node'
env: BROWSER_NAME=ie BROWSER_VERSION=8
- node_js: 'node'
env: BROWSER_NAME=ie BROWSER_VERSION=9
- node_js: 'node'
env: BROWSER_NAME=ie BROWSER_VERSION=10
- node_js: 'node'
env: BROWSER_NAME=ie BROWSER_VERSION=11
- node_js: 'node'
env: BROWSER_NAME=iphone BROWSER_VERSION=8.4
- node_js: 'node'
env: BROWSER_NAME=iphone BROWSER_VERSION=9.2
- node_js: 'node'
env: BROWSER_NAME=iphone BROWSER_VERSION=10.0
- node_js: 'node'
env: BROWSER_NAME=android BROWSER_VERSION=4.4
- node_js: 'node'
env: BROWSER_NAME=android BROWSER_VERSION=5.1
- node_js: 'node'
env: BROWSER_NAME=ipad BROWSER_VERSION=9.3
- node_js: 'node'
env: BROWSER_NAME=ipad BROWSER_VERSION=10.0
- node_js: node
env: BROWSERS=1
cache:
directories:
- node_modules
env:
global:
- secure: EeWHa83dNLzbmwn7tai2D7nnqRMhpbZrWh8054je+6M2Iui6heV412ginyx+MfTBkDe9PF9yPhoknpJ1ZiitbFHVhdofzJJErEHWS33gLVXTL2PU1IzAU9h9T/wVSrVsiNfTARW4Bh9JexVl8x8erTzSh/P6fH2KWx4CaPtmYG4=
- secure: 0yzzTFfFW032oyHzLJPkjgtehnJiqbpmI5kPosjC3Nk0AT6wLSdXuo1Cv5mccggPoqtHQ4oo7e4roLgRaZD34ihc2n98oT5LUPoU6ifA2Z+1zmdmFS9oYTvmkMxaxHlyYuWn47INukGLVJkH5mukb4QDji+v2LjbZVGdVHL5iNM=
- secure: l2aD07VwTMZh+8dcE7u7X0lpdYuwl/wk5no1hxaOKvnHiaVSW39kEJFReO0EZXF/ld7teBNwdWVtRK0P28hKjXEr4Z1OjvGyz6WYZ6cSwxAPmDoTaKC4z1NsAlatqjOKyjSqadncYzWwKS+Trxgj8eO1mZt5h+EvgU2gz6l2N+I=
15 changes: 2 additions & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const FILES_TO_CLEAN = [
];

gulp.task('test', ['lint'], function () {
if (process.env.hasOwnProperty('BROWSER_NAME')) {
if (process.env.hasOwnProperty('BROWSERS')) {
return testZuul();
} else {
return testNode();
Expand Down Expand Up @@ -78,18 +78,7 @@ function testNode () {
// runs zuul through shell process
function testZuul () {
const ZUUL_CMD = './node_modules/zuul/bin/zuul';
const args = [
'--browser-name',
process.env.BROWSER_NAME,
'--browser-version',
process.env.BROWSER_VERSION
];
if (process.env.hasOwnProperty('BROWSER_PLATFORM')) {
args.push('--browser-platform');
args.push(process.env.BROWSER_PLATFORM);
}
args.push(TEST_FILE);
const zuulChild = child.spawn(ZUUL_CMD, args, { stdio: 'inherit' });
const zuulChild = child.spawn(ZUUL_CMD, [TEST_FILE], { stdio: 'inherit' });
zuulChild.on('exit', function (code) {
cleanFiles(FILES_TO_CLEAN);
process.exit(code);
Expand Down
8 changes: 3 additions & 5 deletions lib/transports/polling-xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,9 @@ Request.prototype.onLoad = function () {
contentType = this.xhr.getResponseHeader('Content-Type');
} catch (e) {}
if (contentType === 'application/octet-stream') {
if (this.xhr.responseType === 'arraybuffer') {
data = this.xhr.response || this.xhr.responseText;
} else {
data = String.fromCharCode.apply(null, new Uint8Array(this.xhr.response));
}
data = this.xhr.response || this.xhr.responseText;
} else if (this.xhr.responseType === 'arraybuffer') {
data = String.fromCharCode.apply(null, new Uint8Array(this.xhr.response));
} else {
data = this.xhr.responseText;
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"gulp-task-listing": "1.0.1",
"istanbul": "^0.4.5",
"mocha": "^3.2.0",
"socket.io-browsers": "^1.0.0",
"webpack": "1.12.12",
"webpack-stream": "^3.2.0",
"zuul": "^3.11.1",
Expand Down
8 changes: 5 additions & 3 deletions test/engine.io-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
var expect = require('expect.js');
var eio = require('../');

var expectedPort = global.location && 'https:' === location.protocol ? '443' : '80';

describe('engine.io-client', function () {
var open;

Expand Down Expand Up @@ -45,7 +47,7 @@ describe('engine.io-client', function () {
it('should properly parse a host without port', function () {
var client = eio({ host: 'localhost' });
expect(client.hostname).to.be('localhost');
expect(client.port).to.be('80');
expect(client.port).to.be(expectedPort);
});

it('should properly parse a host with port', function () {
Expand All @@ -69,7 +71,7 @@ describe('engine.io-client', function () {
it('should properly parse an IPv6 host without port (1/2)', function () {
var client = eio({ host: '[::1]' });
expect(client.hostname).to.be('::1');
expect(client.port).to.be('80');
expect(client.port).to.be(expectedPort);
});

it('should properly parse an IPv6 host without port (2/2)', function () {
Expand All @@ -87,6 +89,6 @@ describe('engine.io-client', function () {
it('should properly parse an IPv6 host without brace', function () {
var client = eio({ host: '::1' });
expect(client.hostname).to.be('::1');
expect(client.port).to.be('80');
expect(client.port).to.be(expectedPort);
});
});
22 changes: 19 additions & 3 deletions zuul.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
'use strict';

var browsers = require('socket.io-browsers');

var zuulConfig = module.exports = {
ui: 'mocha-bdd',

// test on localhost by default
local: true,

concurrency: 2, // ngrok only accepts two tunnels by default
// if browser does not sends output in 120s since last output:
// stop testing, something is wrong
browser_output_timeout: 120 * 1000,
browser_open_timeout: 60 * 4 * 1000,
// we want to be notified something is wrong asap, so no retry
browser_retries: 1,

server: './test/support/server.js',
local: true, // test on localhost by default
builder: 'zuul-builder-webpack',
webpack: require('./support/webpack.config.js')
};
Expand All @@ -11,7 +25,9 @@ if (process.env.CI === 'true') {
zuulConfig.local = false;
zuulConfig.tunnel = {
type: 'ngrok',
authtoken: '6Aw8vTgcG5EvXdQywVvbh_3fMxvd4Q7dcL2caAHAFjV',
proto: 'tcp'
bind_tls: true
};
}

var isPullRequest = process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST !== 'false';
zuulConfig.browsers = isPullRequest ? browsers.pullRequest : browsers.all;