Bug 1412122: relax ICE connection state checking. r?bwc draft
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Wed, 25 Oct 2017 16:42:29 -0700
changeset 689769 f8ef3acb183e9053e9f23f88422f0e022f02a5ef
parent 689768 026a6819dbbf9aa9238ad70a16037f88b1dfac5b
child 689770 ef775bce8f8b2a1c67f73c2a9cfecd8ddecda501
push id87100
push userdrno@ohlmeier.org
push dateTue, 31 Oct 2017 22:50:29 +0000
reviewersbwc
bugs1412122
milestone58.0a1
Bug 1412122: relax ICE connection state checking. r?bwc MozReview-Commit-ID: 8AZMqpxPTvP
dom/media/tests/mochitest/head.js
dom/media/tests/mochitest/pc.js
--- 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": []