Backed out changeset e04692266f17 (bug 1095438) for B2G mochitest permafails.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 25 Nov 2014 11:34:48 -0500
changeset 217488 997d1d16fc19878c0a370d972e2353184b59c09b
parent 217487 d9daaa5f90942f31429b9a75a973b44be84007dc
child 217489 ced1402861b8e0d0c59b42ba379281bd3a80926b
push id27882
push userryanvm@gmail.com
push dateTue, 25 Nov 2014 21:56:56 +0000
treeherdermozilla-central@ced1402861b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1095438
milestone36.0a1
backs oute04692266f1754d8eced81a8b8ab5514f4b79722
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 e04692266f17 (bug 1095438) for B2G mochitest permafails. CLOSED TREE
dom/html/HTMLMediaElement.cpp
dom/media/test/test_load_candidates.html
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -2465,17 +2465,17 @@ nsresult HTMLMediaElement::BindToTree(ns
     mAutoplayEnabled =
       IsAutoplayEnabled() && (!aDocument || !aDocument->IsStaticDocument()) &&
       !IsEditable();
     // The preload action depends on the value of the autoplay attribute.
     // It's value may have changed, so update it.
     UpdatePreloadAction();
   }
   if (mDecoder) {
-    mDecoder->SetDormantIfNecessary(OwnerDoc()->Hidden());
+    mDecoder->SetDormantIfNecessary(false);
   }
 
   return rv;
 }
 
 void HTMLMediaElement::UnbindFromTree(bool aDeep,
                                       bool aNullParent)
 {
@@ -3462,22 +3462,17 @@ void HTMLMediaElement::SuspendOrResumeEl
 }
 
 void HTMLMediaElement::NotifyOwnerDocumentActivityChanged()
 {
   nsIDocument* ownerDoc = OwnerDoc();
 
   if (mDecoder) {
     mDecoder->SetElementVisibility(!ownerDoc->Hidden());
-    // Since we enter dormant state in UnbindFromTree(),
-    // we should only leave dormant state after binding to the tree.
-    nsCOMPtr<nsIDOMNode> parent;
-    nsresult rv = GetParentNode(getter_AddRefs(parent));
-    bool hasParent = NS_SUCCEEDED(rv) && parent;
-    mDecoder->SetDormantIfNecessary(ownerDoc->Hidden() || !hasParent);
+    mDecoder->SetDormantIfNecessary(ownerDoc->Hidden());
   }
 
   // SetVisibilityState will update mMuted with MUTED_BY_AUDIO_CHANNEL via the
   // CanPlayChanged callback.
   if (UseAudioChannelService() && mPlayingThroughTheAudioChannel &&
       mAudioChannelAgent) {
     AutoNoJSAPI nojsapi;
     mAudioChannelAgent->SetVisibilityState(!ownerDoc->Hidden());
--- a/dom/media/test/test_load_candidates.html
+++ b/dom/media/test/test_load_candidates.html
@@ -19,66 +19,64 @@ https://bugzilla.mozilla.org/show_bug.cg
 <script type="application/javascript">
 
 /** Test for Bug 465458 **/
 
 var manager = new MediaTestManager;
 
 function finish(evt) {
   var v = evt.target;
-  info("Got loadeddata: " + v.token);
   is(v._error, 2, "Should have received 2 error events before loaded");
+  v._finished = true;
   // remove error event handler, because this would otherwise
   // cause a failure on Windows 7, see bug 1024535
   v.onerror = null;
   v.parentNode.removeChild(v);
   manager.finished(v.token);
 }
 
 function errorHandler(evt) {
-  info("Got error event: " + evt.target.parentNode.token + " (" + evt.target.src + ")");
   evt.target.parentNode._error++;
 }
 
 var extension = {
   "audio/wav" : "wav",
   "audio/x-wav": "wav",
   "video/ogg" : "ogv",
   "audio/ogg" : "oga",
   "video/webm" : "webm"
 };
 
 function startTest(test, token) {
   var v = document.createElement('video');
   v.preload = "auto";
-  v.onerror = function() {
-    ok(false,"Error events on source children should not bubble");
-  }
+  v.onerror = function(){ok(false,"Error events on source children should not bubble");}
   v.token = token;
   manager.started(token);
   v._error = 0;
+  v._finished = false;
   v._name = test.name;
 
   var s1 = document.createElement("source");
   s1.type = test.type;
   s1.src = "404." + extension[test.type];
   s1.addEventListener("error", errorHandler, false);
   v.appendChild(s1);
-
+  
   var s2 = document.createElement("source");
   s2.type = test.type;
   s2.src = "test_load_candidates.html"; // definitely an invalid media file, regardless of its actual mime type...
   s2.addEventListener("error", errorHandler, false);
   v.appendChild(s2);
-
+    
   var s3 = document.createElement("source");
   s3.type = test.type;
   s3.src = test.name;
   v.appendChild(s3);
-
+  
   v.addEventListener("loadeddata", finish, false);
   document.body.appendChild(v);
 }
 
 manager.runTests(gSmallTests, startTest);
 
 </script>
 </pre>