chrome-remote-interface
Advanced tools
Comparing version 0.12.1 to 0.12.2
@@ -176,3 +176,3 @@ var defaults = require('./defaults.js'); | ||
} | ||
descriptor = parse(data); | ||
descriptor = JSON.parse(data); | ||
} catch (_) { | ||
@@ -179,0 +179,0 @@ // fall back |
@@ -12,3 +12,3 @@ { | ||
"homepage": "https://github.com/cyrus-and/chrome-remote-interface", | ||
"version": "0.12.1", | ||
"version": "0.12.2", | ||
"repository": { | ||
@@ -15,0 +15,0 @@ "type": "git", |
@@ -9,5 +9,6 @@ var Chrome = require('../'); | ||
describe('with callback', function () { | ||
it('should return the protocol descriptor (possibly) from Chrome', function (done) { | ||
it('should return the protocol descriptor from Chrome', function (done) { | ||
Chrome.Protocol(function (err, protocol) { | ||
assert.ifError(err); | ||
assert(!protocol.fallback); | ||
assert.equal(typeof protocol.descriptor, 'object'); | ||
@@ -18,6 +19,6 @@ assert.equal(typeof protocol.descriptor.version, 'object'); | ||
}); | ||
it('should return the hardcoded protocol descriptor', function (done) { | ||
it('should return the hardcoded protocol descriptor (on error)', function (done) { | ||
Chrome.Protocol({'port':1}, function (err, protocol) { | ||
assert.ifError(err); | ||
assert(!protocol.fromChrome); | ||
assert(protocol.fallback); | ||
assert.equal(typeof protocol.descriptor, 'object'); | ||
@@ -28,6 +29,16 @@ assert.equal(typeof protocol.descriptor.version, 'object'); | ||
}); | ||
it('should return the hardcoded protocol descriptor (if requested)', function (done) { | ||
Chrome.Protocol({'fallback': true}, function (err, protocol) { | ||
assert.ifError(err); | ||
assert(protocol.fallback); | ||
assert.equal(typeof protocol.descriptor, 'object'); | ||
assert.equal(typeof protocol.descriptor.version, 'object'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
describe('without callback', function () { | ||
it('should return the protocol descriptor (possibly) from Chrome', function (done) { | ||
it('should return the protocol descriptor from Chrome', function (done) { | ||
Chrome.Protocol().then(function (protocol) { | ||
assert(!protocol.fallback); | ||
assert.equal(typeof protocol.descriptor, 'object'); | ||
@@ -40,5 +51,5 @@ assert.equal(typeof protocol.descriptor.version, 'object'); | ||
}); | ||
it('should return the hardcoded protocol descriptor', function (done) { | ||
it('should return the hardcoded protocol descriptor (on error)', function (done) { | ||
Chrome.Protocol({'port':1}).then(function (protocol) { | ||
assert(!protocol.fromChrome); | ||
assert(protocol.fallback); | ||
assert.equal(typeof protocol.descriptor, 'object'); | ||
@@ -51,2 +62,12 @@ assert.equal(typeof protocol.descriptor.version, 'object'); | ||
}); | ||
it('should return the hardcoded protocol descriptor (if requested)', function (done) { | ||
Chrome.Protocol({'fallback': true}).then(function (protocol) { | ||
assert(protocol.fallback); | ||
assert.equal(typeof protocol.descriptor, 'object'); | ||
assert.equal(typeof protocol.descriptor.version, 'object'); | ||
done(); | ||
}).catch(function () { | ||
assert(false); | ||
}); | ||
}); | ||
}); | ||
@@ -53,0 +74,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
362968
6276