Backed out changeset 324833b27740 (bug 1054706) for the suspicion of causing frequent e10s m3 test failures
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 26 Aug 2014 10:59:17 +0200
changeset 223261 c7ccab163c19e00024d772c6b7df55a3544c4531
parent 223260 6d59613b92df36a8f53fd642294b8107903f176c
child 223262 a3bc4d864cce12866a84dfa497794a87ddc0ad04
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1054706
milestone34.0a1
backs out324833b277403ab63ca5a9a386edc371fba57a77
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
Backed out changeset 324833b27740 (bug 1054706) for the suspicion of causing frequent e10s m3 test failures
dom/media/tests/mochitest/pc.js
dom/media/tests/mochitest/test_dataChannel_basicAudioVideo.html
dom/media/tests/mochitest/test_peerConnection_basicH264Video.html
dom/media/tests/mochitest/test_peerConnection_basicVideo.html
--- a/dom/media/tests/mochitest/pc.js
+++ b/dom/media/tests/mochitest/pc.js
@@ -271,21 +271,21 @@ CommandChain.prototype = {
  * This class provides a state checker for media elements which store
  * a media stream to check for media attribute state and events fired.
  * When constructed by a caller, an object instance is created with
  * a media element, event state checkers for canplaythrough, timeupdate, and
  * time changing on the media element and stream.
  *
  * @param {HTMLMediaElement} element the media element being analyzed
  */
-function MediaElementChecker(element, expectVideo) {
+function MediaElementChecker(element) {
   this.element = element;
   this.canPlayThroughFired = false;
   this.timeUpdateFired = false;
-  this.hasRenderedMedia = false;
+  this.timePassed = false;
 
   var self = this;
   var elementId = self.element.getAttribute('id');
 
   // When canplaythrough fires, we track that it's fired and remove the
   // event listener.
   var canPlayThroughCallback = function() {
     info('canplaythrough fired for media element ' + elementId);
@@ -300,31 +300,19 @@ function MediaElementChecker(element, ex
     self.timeUpdateFired = true;
     info('timeupdate fired for media element ' + elementId);
 
     // If time has passed, then track that and remove the timeupdate event
     // listener.
     if(element.mozSrcObject && element.mozSrcObject.currentTime > 0 &&
        element.currentTime > 0) {
       info('time passed for media element ' + elementId);
-      // We know element isn't fixed; null tells us it or some parent is display:none if not fixed
-      if(expectVideo && !(element.offsetParent === null)) {
-        if(element.mozPaintedFrames > 0) {
-	  info(element.mozPaintedFrames + ' frames have painted');
-          self.hasRenderedMedia = true;
-        }
-      } else {
-        // XXX punt for now; don't see a good way to find if audio actually played
-        // Maybe mozCaptureStream, route to WebAudio?  Ugh
-        self.hasRenderedMedia = true;
-      }
-      if (self.hasRenderedMedia) {
-        self.element.removeEventListener('timeupdate', timeUpdateCallback,
-                                         false);
-      }
+      self.timePassed = true;
+      self.element.removeEventListener('timeupdate', timeUpdateCallback,
+                                       false);
     }
   };
 
   element.addEventListener('canplaythrough', canPlayThroughCallback, false);
   element.addEventListener('timeupdate', timeUpdateCallback, false);
 }
 
 MediaElementChecker.prototype = {
@@ -336,17 +324,17 @@ MediaElementChecker.prototype = {
    * @param {Function} onSuccess the success callback when media flow is
    *                             established
    */
   waitForMediaFlow : function MEC_WaitForMediaFlow(onSuccess) {
     var self = this;
     var elementId = self.element.getAttribute('id');
     info('Analyzing element: ' + elementId);
 
-    if(self.canPlayThroughFired && self.timeUpdateFired && self.hasRenderedMedia) {
+    if(self.canPlayThroughFired && self.timeUpdateFired && self.timePassed) {
       ok(true, 'Media flowing for ' + elementId);
       onSuccess();
     } else {
       setTimeout(function() {
         self.waitForMediaFlow(onSuccess);
       }, 100);
     }
   },
@@ -545,22 +533,22 @@ function PeerConnectionTest(options) {
       }
       if (!options.config_remote.hasOwnProperty("iceServers")) {
         options.config_remote.iceServers = turnServers.remote.iceServers;
       }
     }
   }
 
   if (options.is_local)
-    this.pcLocal = new PeerConnectionWrapper('pcLocal', options, true);
+    this.pcLocal = new PeerConnectionWrapper('pcLocal', options.config_local, options.h264);
   else
     this.pcLocal = null;
 
   if (options.is_remote)
-    this.pcRemote = new PeerConnectionWrapper('pcRemote', options, false);
+    this.pcRemote = new PeerConnectionWrapper('pcRemote', options.config_remote || options.config_local, options.h264);
   else
     this.pcRemote = null;
 
   // Create command chain instance and assign default commands
   this.chain = new CommandChain(this, options.commands);
   if (!options.is_local) {
     this.chain.filterOut(/^PC_LOCAL/);
   }
@@ -1361,39 +1349,35 @@ DataChannelWrapper.prototype = {
 
 
 /**
  * This class acts as a wrapper around a PeerConnection instance.
  *
  * @constructor
  * @param {string} label
  *        Description for the peer connection instance
- * @param {object} options
- *        Optional options for the peer connection test
- * @param {bool} local
- *        if this is constructing the local or remote peerconnection
+ * @param {object} configuration
+ *        Configuration for the peer connection instance
  */
-function PeerConnectionWrapper(label, options, local) {
-  this.configuration = local ? options.config_local :
-                               (options.config_remote || options.config_local);
+function PeerConnectionWrapper(label, configuration, h264) {
+  this.configuration = configuration;
   this.label = label;
   this.whenCreated = Date.now();
 
   this.constraints = [ ];
   this.offerOptions = {};
   this.streams = [ ];
   this.mediaCheckers = [ ];
 
   this.dataChannels = [ ];
 
   this.onAddStreamFired = false;
   this.addStreamCallbacks = {};
 
-  // This is probably overly baroque
-  this.h264 = typeof options.h264 !== "undefined" ? options.h264 : false;
+  this.h264 = typeof h264 !== "undefined" ? true : false;
 
   info("Creating " + this);
   this._pc = new mozRTCPeerConnection(this.configuration);
 
   /**
    * Setup callback handlers
    */
   var self = this;
@@ -1545,17 +1529,17 @@ PeerConnectionWrapper.prototype = {
 
   /**
    * Callback when we get media from either side. Also an appropriate
    * HTML media element will be created.
    *
    * @param {MediaStream} stream
    *        Media stream to handle
    * @param {string} type
-   *        The type of media stream ('audio' or 'video' or 'audiovideo')
+   *        The type of media stream ('audio' or 'video')
    * @param {string} side
    *        The location the stream is coming from ('local' or 'remote')
    */
   attachMedia : function PCW_attachMedia(stream, type, side) {
     info("Got media stream: " + type + " (" + side + ")");
     this.streams.push(stream);
 
     if (side === 'local') {
@@ -1566,17 +1550,17 @@ PeerConnectionWrapper.prototype = {
       } else {
         stream.getTracks().forEach(function(track) {
           this._pc.addTrack(track, stream);
         }.bind(this));
       }
     }
 
     var element = createMediaElement(type, this.label + '_' + side);
-    this.mediaCheckers.push(new MediaElementChecker(element, type == "video" || type == "audiovideo"));
+    this.mediaCheckers.push(new MediaElementChecker(element));
     element.mozSrcObject = stream;
     element.play();
   },
 
   /**
    * Requests all the media streams as specified in the constrains property.
    *
    * @param {function} onSuccess
--- a/dom/media/tests/mochitest/test_dataChannel_basicAudioVideo.html
+++ b/dom/media/tests/mochitest/test_dataChannel_basicAudioVideo.html
@@ -8,18 +8,17 @@
   <script type="application/javascript" src="templates.js"></script>
   <script type="application/javascript" src="turnConfig.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "796891",
-    title: "Basic data channel audio/video connection",
-    visible: true
+    title: "Basic data channel audio/video connection"
   });
 
   var test;
   runNetworkTest(function () {
     test = new DataChannelTest();
     test.setMediaConstraints([{audio: true}, {video: true}],
                              [{audio: true}, {video: true}]);
     test.run();
--- a/dom/media/tests/mochitest/test_peerConnection_basicH264Video.html
+++ b/dom/media/tests/mochitest/test_peerConnection_basicH264Video.html
@@ -9,18 +9,17 @@
   <script type="application/javascript" src="templates.js"></script>
   <script type="application/javascript" src="turnConfig.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript;version=1.8">
   createHTML({
     bug: "1040346",
-    title: "Basic H.264 GMP video-only peer connection",
-    visible: true
+    title: "Basic H.264 GMP video-only peer connection"
   });
 
   var test;
   runNetworkTest(function (options) {
     options = options || { };
     options.h264 = true;
     test = new PeerConnectionTest(options);
     test.setMediaConstraints([{video: true}], [{video: true}]);
--- a/dom/media/tests/mochitest/test_peerConnection_basicVideo.html
+++ b/dom/media/tests/mochitest/test_peerConnection_basicVideo.html
@@ -9,18 +9,17 @@
   <script type="application/javascript" src="templates.js"></script>
   <script type="application/javascript" src="turnConfig.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "796888",
-    title: "Basic video-only peer connection",
-    visible: true
+    title: "Basic video-only peer connection"
   });
 
   var test;
   runNetworkTest(function (options) {
     test = new PeerConnectionTest(options);
     test.setMediaConstraints([{video: true}], [{video: true}]);
     test.run();
   });