From 3ccea9b2b812062617ed618f51fa3c78f1a441ab Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Tue, 25 Nov 2014 11:34:48 -0500 Subject: [PATCH] Backed out changeset e04692266f17 (bug 1095438) for B2G mochitest permafails. CLOSED TREE --- dom/html/HTMLMediaElement.cpp | 9 ++------- dom/media/test/test_load_candidates.html | 14 ++++++-------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 1d080ea2b727..96e377fc67b4 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -2470,7 +2470,7 @@ nsresult HTMLMediaElement::BindToTree(nsIDocument* aDocument, nsIContent* aParen UpdatePreloadAction(); } if (mDecoder) { - mDecoder->SetDormantIfNecessary(OwnerDoc()->Hidden()); + mDecoder->SetDormantIfNecessary(false); } return rv; @@ -3467,12 +3467,7 @@ void HTMLMediaElement::NotifyOwnerDocumentActivityChanged() 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 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 diff --git a/dom/media/test/test_load_candidates.html b/dom/media/test/test_load_candidates.html index d256a0123b3a..621f1e85b2f2 100644 --- a/dom/media/test/test_load_candidates.html +++ b/dom/media/test/test_load_candidates.html @@ -24,8 +24,8 @@ 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; @@ -34,7 +34,6 @@ function finish(evt) { } function errorHandler(evt) { - info("Got error event: " + evt.target.parentNode.token + " (" + evt.target.src + ")"); evt.target.parentNode._error++; } @@ -49,12 +48,11 @@ var extension = { 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"); @@ -62,18 +60,18 @@ function startTest(test, token) { 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); }