Backed out changeset feea8b1ea75f (bug 1095438) for possibly breaking mulet 1 tests
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 25 Nov 2014 12:41:01 +0100
changeset 241782 351a308ffe20c33bb7d740d8925209226bce673a
parent 241781 daab9019a6176f5ea2189e2a1562289d5fd0d331
child 241783 0164b161e0d88b50e1a24b301708ef973c68843f
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)
bugs1095438
milestone36.0a1
backs outfeea8b1ea75fb079ea238c285a8e2399d01a080b
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 feea8b1ea75f (bug 1095438) for possibly breaking mulet 1 tests
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>