backout Bug 533840, since it added a randomly failing test

--HG--
extra : rebase_source : c9f9de9148b5a52bf7013b543035626d959c6e5a
This commit is contained in:
Olli Pettay 2013-07-09 13:30:38 -04:00
commit 16127542ea
4 changed files with 2 additions and 69 deletions

View File

@ -1130,9 +1130,6 @@ protected:
// Is this media element playing?
bool mPlayingThroughTheAudioChannel;
// Has this element been in a document?
bool mWasInDocument;
// An agent used to join audio channel service.
nsCOMPtr<nsIAudioChannelAgent> mAudioChannelAgent;

View File

@ -1946,8 +1946,7 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed<nsINodeInfo> aNodeInfo)
mHasAudio(false),
mDownloadSuspendedByCache(false),
mAudioChannelType(AUDIO_CHANNEL_NORMAL),
mPlayingThroughTheAudioChannel(false),
mWasInDocument(false)
mPlayingThroughTheAudioChannel(false)
{
#ifdef PR_LOGGING
if (!gMediaElementLog) {
@ -2372,8 +2371,6 @@ nsresult HTMLMediaElement::BindToTree(nsIDocument* aDocument, nsIContent* aParen
// It's value may have changed, so update it.
UpdatePreloadAction();
mWasInDocument = true;
if (aDocument->HasAudioAvailableListeners()) {
// The document already has listeners for the "MozAudioAvailable"
// event, so the decoder must be notified so it initiates
@ -2388,9 +2385,8 @@ nsresult HTMLMediaElement::BindToTree(nsIDocument* aDocument, nsIContent* aParen
void HTMLMediaElement::UnbindFromTree(bool aDeep,
bool aNullParent)
{
if (!mPaused && mNetworkState != nsIDOMHTMLMediaElement::NETWORK_EMPTY) {
if (!mPaused && mNetworkState != nsIDOMHTMLMediaElement::NETWORK_EMPTY)
Pause();
}
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}
@ -3089,10 +3085,7 @@ bool HTMLMediaElement::CanActivateAutoplay()
// For stream inputs, we activate autoplay on HAVE_CURRENT_DATA because
// this element itself might be blocking the stream from making progress by
// being paused.
// If we were in a document, but we have been removed, we should not start the
// playback.
return !mPausedForInactiveDocumentOrChannel &&
mWasInDocument && IsInDoc() &&
mAutoplaying &&
mPaused &&
(mDownloadSuspendedByCache ||

View File

@ -135,7 +135,6 @@ MOCHITEST_FILES = \
test_streams_autoplay.html \
test_streams_gc.html \
test_streams_tracks.html \
test_paused_after_removed.html \
$(filter disabled-for-intermittent-failures--bug-608634, test_error_in_video_document.html) \
test_texttrack.html \
test_texttrackcue.html \

View File

@ -1,56 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=533840
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 533840</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="text/javascript" src="manifest.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=533840">Mozilla Bug 533840</a>
<pre id="test">
<script class="testbody" type="text/javascript">
/* Test for Bug 533840 */
var manager = new MediaTestManager;
function onloadstart(event) {
var video = event.target;
video.parentNode.removeChild(video);
ok(video.paused, "Media should be paused.");
// wait a bit to check we won't receive the a "play" event.
setTimeout(function() {
video.removeEventListener("loadstart", onloadstart);
video.src = "";
manager.finished(video.token);
}, 3000);
}
function onplay(event) {
ok(false, "Should not receive a play event.");
}
function startTest(test, token) {
var video = document.createElement('video');
video.token = token;
manager.started(token);
video.src = test.name;
video.preload = "auto";
video.autoplay = true;
video.addEventListener("loadstart", onloadstart);
video.addEventListener("play", onplay);
SimpleTest.waitForExplicitFinish();
document.body.appendChild(video);
}
manager.runTests(gProgressTests, startTest);
</script>
</pre>
</body>
</html>