Bug 1101770 - add an over all timeout for steeplecahse tests. r=spolk
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Wed, 19 Nov 2014 14:01:00 +0100
changeset 241366 9c7a7f4ca6ce86094ac5953e4e35cd0a81f0bfc0
parent 241365 4ad7f3e41256fda71e4667f76914a967c0dda557
child 241367 fb04b97910ffb2c6040efb4b4779c77c3ea44cf1
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspolk
bugs1101770
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1101770 - add an over all timeout for steeplecahse tests. r=spolk
dom/media/tests/mochitest/pc.js
dom/media/tests/mochitest/templates.js
--- a/dom/media/tests/mochitest/pc.js
+++ b/dom/media/tests/mochitest/pc.js
@@ -673,16 +673,27 @@ PeerConnectionTest.prototype.next = func
 PeerConnectionTest.prototype.setStepTimeout = function(ms) {
   this._stepTimeout = setTimeout(function() {
     ok(false, "Step timed out: " + this.chain.currentStepLabel);
     this.next();
   }.bind(this), ms);
 };
 
 /**
+ * Set a timeout for the over all PeerConnectionTest
+ * @param {long] ms the number of milliseconds to allow for the test
+ */
+PeerConnectionTest.prototype.setTimeout = function(ms) {
+  this._timeout = setTimeout(function() {
+    ok(false, "PeerConnectionTest timed out");
+    this.teardown();
+  }.bind(this), ms);
+};
+
+/**
  * Creates an answer for the specified peer connection instance
  * and automatically handles the failure case.
  *
  * @param {PeerConnectionWrapper} peer
  *        The peer connection wrapper to run the command on
  * @param {function} onSuccess
  *        Callback to execute if the offer was created successfully
  */
--- a/dom/media/tests/mochitest/templates.js
+++ b/dom/media/tests/mochitest/templates.js
@@ -62,16 +62,17 @@ function dumpSdp(test) {
   }
 }
 
 var commandsPeerConnection = [
   [
     'PC_SETUP_SIGNALING_CLIENT',
     function (test) {
       if (test.steeplechase) {
+        test.setTimeout(30000);
         test.setupSignalingClient();
         test.registerSignalingCallback("ice_candidate", function (message) {
           var pc = test.pcRemote ? test.pcRemote : test.pcLocal;
           pc.storeOrAddIceCandidate(new mozRTCIceCandidate(message.ice_candidate));
         });
         test.registerSignalingCallback("end_of_trickle_ice", function (message) {
           test.signalingMessagesFinished();
         });