Skip to content

Commit

Permalink
Merge pull request #555 from fippo/revert-549-unRevert
Browse files Browse the repository at this point in the history
Revert "Revert "Revert "Merge pull request #527 from fippo/rtcicecandidate"""
  • Loading branch information
KaptenJansson authored May 18, 2017
2 parents b4c5526 + a8ac0cc commit 2b32263
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 278 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test": "grunt && mocha test/unit && node test/run-tests.js"
},
"dependencies": {
"sdp": "^1.5.1"
"sdp": "^1.5.0"
},
"engines": {
"npm": ">=3.10.0",
Expand Down
5 changes: 0 additions & 5 deletions src/js/adapter_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
var edgeShim = require('./edge/edge_shim') || null;
var firefoxShim = require('./firefox/firefox_shim') || null;
var safariShim = require('./safari/safari_shim') || null;
var commonShim = require('./common');

// Shim browser if found.
switch (browserDetails.browser) {
Expand Down Expand Up @@ -97,9 +96,5 @@
break;
default:
logging('Unsupported browser!');
break;
}

// common shims.
commonShim.shimRTCIceCandidate(); // augmented RTCIceCandidate
})();
108 changes: 0 additions & 108 deletions src/js/common.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/js/edge/edge_shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
shimPeerConnection: function() {
if (window.RTCIceGatherer) {
// ORTC defines an RTCIceCandidate object but no constructor.
// Not implemented in in some versions of Edge.
// Not implemented in Edge.
if (!window.RTCIceCandidate) {
window.RTCIceCandidate = function(args) {
return args;
Expand Down
83 changes: 0 additions & 83 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2963,89 +2963,6 @@ test('ontrack', function(t) {
});
});

test('augmented RTCIceCandidate', function(t) {
var driver = seleniumHelpers.buildDriver();

// Define test.
var testDefinition = function() {
var callback = arguments[arguments.length - 1];

var hasProperty = false;
var pc = new RTCPeerConnection();
pc.addEventListener('icecandidate', function(e) {
if (!e.candidate) {
callback(hasProperty);
return;
}
hasProperty = e.candidate.port !== undefined;
});
pc.createOffer({offerToReceiveAudio: true})
.then(function(offer) {
return pc.setLocalDescription(offer);
});
};

// Run test.
seleniumHelpers.loadTestPage(driver)
.then(function() {
t.pass('Page loaded');
return driver.executeAsyncScript(testDefinition);
})
.then(function(hasProperty) {
t.ok(hasProperty === true, 'candidate was augmented');
t.end();
})
.then(null, function(err) {
if (err !== 'skip-test') {
t.fail(err);
}
t.end();
});
});

test('augmented RTCIceCandidate eventlistener overload', function(t) {
var driver = seleniumHelpers.buildDriver();

// Define test.
var testDefinition = function() {
var callback = arguments[arguments.length - 1];

var pc = new RTCPeerConnection();
var calledWrong = false;
var wrongCb = function(e) {
calledWrong = true;
};
pc.addEventListener('icecandidate', wrongCb);
pc.removeEventListener('icecandidate', wrongCb);
pc.addEventListener('icecandidate', function(e) {
if (!e.candidate) {
callback(calledWrong);
}
});
pc.createOffer({offerToReceiveAudio: true})
.then(function(offer) {
return pc.setLocalDescription(offer);
});
};

// Run test.
seleniumHelpers.loadTestPage(driver)
.then(function() {
t.pass('Page loaded');
return driver.executeAsyncScript(testDefinition);
})
.then(function(calledWrongCallback) {
t.ok(calledWrongCallback === false, 'the removed callback was not called.');
t.end();
})
.then(null, function(err) {
if (err !== 'skip-test') {
t.fail(err);
}
t.end();
});
});

// This MUST to be the last test since it loads adapter
// again which may result in unintended behaviour.
test('Non-module logging to console still works', function(t) {
Expand Down
80 changes: 0 additions & 80 deletions test/unit/rtcicecandidate.js

This file was deleted.

0 comments on commit 2b32263

Please sign in to comment.