Bug 1412122: relax ICE connection state checking. r?bwc
MozReview-Commit-ID: 8AZMqpxPTvP
--- a/dom/media/tests/mochitest/head.js
+++ b/dom/media/tests/mochitest/head.js
@@ -743,20 +743,25 @@ CommandChain.prototype = {
throw new Error('registered non-function' + next);
}
return prev.then(() => {
info('Run step ' + (i + 1) + ': ' + next.name);
return Promise.race([ next(this._framework), rejectOnUnexpectedEvent ]);
});
}, Promise.resolve())
- .catch(e =>
- ok(false, 'Error in test execution: ' + e +
- ((typeof e.stack === 'string') ?
- (' ' + e.stack.split('\n').join(' ... ')) : '')));
+ .catch(e => {
+ if (e) {
+ ok(false, 'Error in test execution: ' + e +
+ ((typeof e.stack === 'string') ?
+ (' ' + e.stack.split('\n').join(' ... ')) : ''));
+ } else {
+ ok(false, 'Error in test execution with no error object');
+ }
+ });
},
/**
* Add new commands to the end of the chain
*/
append: function(commands) {
this.commands = this.commands.concat(commands);
},
--- a/dom/media/tests/mochitest/pc.js
+++ b/dom/media/tests/mochitest/pc.js
@@ -2,18 +2,21 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const LOOPBACK_ADDR = "127.0.0.";
const iceStateTransitions = {
- "new": ["checking", "closed"], //Note: 'failed' might need to added here
- // even though it is not in the standard
+ "new": ["checking", "connected", "failed", "closed"], //Note: we might receive
+ // the event after
+ // another state
+ // transition so allow
+ // of them
"checking": ["new", "connected", "failed", "closed"], //Note: do we need to
// allow 'completed' in
// here as well?
"connected": ["new", "completed", "disconnected", "closed"],
"completed": ["new", "disconnected", "closed"],
"disconnected": ["new", "connected", "completed", "failed", "closed"],
"failed": ["new", "disconnected", "closed"],
"closed": []