Backed out changeset 645a7aeef102 (bug 744896) for B2G ICS Emulator Opt Test failures on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 03 Jul 2014 11:50:27 +0200
changeset 192180 1591985577f296873c605b5d07405dd215cd224a
parent 192179 cad7de31731e5a51a158201172438a418f70b834
child 192181 78e474835fc04e722f452baf8bbfe1280ce11be8
push idunknown
push userunknown
push dateunknown
bugs744896
milestone33.0a1
backs out645a7aeef10215bd82d701c083956b88ab163fd3
Backed out changeset 645a7aeef102 (bug 744896) for B2G ICS Emulator Opt Test failures on a CLOSED TREE
content/media/AbstractMediaDecoder.h
content/media/BufferDecoder.cpp
content/media/BufferDecoder.h
content/media/MediaDecoder.cpp
content/media/MediaDecoder.h
content/media/MediaInfo.h
content/media/MediaMetadataManager.h
content/media/MediaTrackList.cpp
content/media/MediaTrackList.h
content/media/test/mochitest.ini
content/media/test/test_mediatrack_consuming_mediaresource.html
content/media/test/test_mediatrack_replay_from_end.html
--- a/content/media/AbstractMediaDecoder.h
+++ b/content/media/AbstractMediaDecoder.h
@@ -88,18 +88,16 @@ public:
   virtual bool IsTransportSeekable() = 0;
 
   // Return true if the transport layer supports seeking.
   virtual bool IsMediaSeekable() = 0;
 
   virtual void MetadataLoaded(MediaInfo* aInfo, MetadataTags* aTags) = 0;
   virtual void QueueMetadata(int64_t aTime, MediaInfo* aInfo, MetadataTags* aTags) = 0;
 
-  virtual void RemoveMediaTracks() = 0;
-
   // Set the media end time in microseconds
   virtual void SetMediaEndTime(int64_t aTime) = 0;
 
   // Make the decoder state machine update the playback position. Called by
   // the reader on the decoder thread (Assertions for this checked by
   // mDecoderStateMachine). This must be called with the decode monitor
   // held.
   virtual void UpdatePlaybackPosition(int64_t aTime) = 0;
@@ -158,31 +156,13 @@ class MetadataEventRunner : public nsRun
 
   // The ownership is transferred to MediaDecoder.
   MediaInfo* mInfo;
 
   // The ownership is transferred to its owning element.
   MetadataTags* mTags;
 };
 
-class RemoveMediaTracksEventRunner : public nsRunnable
-{
-public:
-  RemoveMediaTracksEventRunner(AbstractMediaDecoder* aDecoder)
-    : mDecoder(aDecoder)
-  {}
-
-  NS_IMETHOD Run() MOZ_OVERRIDE
-  {
-    MOZ_ASSERT(NS_IsMainThread());
-
-    mDecoder->RemoveMediaTracks();
-    return NS_OK;
-  }
-
-private:
-  nsRefPtr<AbstractMediaDecoder> mDecoder;
-};
 
 }
 
 #endif
 
--- a/content/media/BufferDecoder.cpp
+++ b/content/media/BufferDecoder.cpp
@@ -154,22 +154,16 @@ BufferDecoder::MetadataLoaded(MediaInfo*
 
 void
 BufferDecoder::QueueMetadata(int64_t aTime, MediaInfo* aInfo, MetadataTags* aTags)
 {
   // ignore
 }
 
 void
-BufferDecoder::RemoveMediaTracks()
-{
-  // ignore
-}
-
-void
 BufferDecoder::SetMediaEndTime(int64_t aTime)
 {
   // ignore
 }
 
 void
 BufferDecoder::UpdatePlaybackPosition(int64_t aTime)
 {
--- a/content/media/BufferDecoder.h
+++ b/content/media/BufferDecoder.h
@@ -58,18 +58,16 @@ public:
 
   virtual bool IsTransportSeekable() MOZ_OVERRIDE;
 
   virtual bool IsMediaSeekable() MOZ_OVERRIDE;
 
   virtual void MetadataLoaded(MediaInfo* aInfo, MetadataTags* aTags) MOZ_OVERRIDE;
   virtual void QueueMetadata(int64_t aTime, MediaInfo* aInfo, MetadataTags* aTags) MOZ_OVERRIDE;
 
-  virtual void RemoveMediaTracks() MOZ_OVERRIDE;
-
   virtual void SetMediaEndTime(int64_t aTime) MOZ_OVERRIDE;
 
   virtual void UpdatePlaybackPosition(int64_t aTime) MOZ_OVERRIDE;
 
   virtual void OnReadMetadataCompleted() MOZ_OVERRIDE;
 
   virtual MediaDecoderOwner* GetOwner() MOZ_OVERRIDE;
 
--- a/content/media/MediaDecoder.cpp
+++ b/content/media/MediaDecoder.cpp
@@ -19,21 +19,16 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/StaticPtr.h"
 #include "nsIMemoryReporter.h"
 #include "nsComponentManagerUtils.h"
 #include "nsITimer.h"
 #include <algorithm>
 #include "MediaShutdownManager.h"
 #include "AudioChannelService.h"
-#include "mozilla/dom/AudioTrack.h"
-#include "mozilla/dom/AudioTrackList.h"
-#include "mozilla/dom/HTMLMediaElement.h"
-#include "mozilla/dom/VideoTrack.h"
-#include "mozilla/dom/VideoTrackList.h"
 
 #ifdef MOZ_WMF
 #include "WMFDecoder.h"
 #endif
 
 using namespace mozilla::layers;
 using namespace mozilla::dom;
 
@@ -433,18 +428,17 @@ MediaDecoder::MediaDecoder() :
   mCalledResourceLoaded(false),
   mIgnoreProgressData(false),
   mInfiniteStream(false),
   mOwner(nullptr),
   mPlaybackStatistics(new MediaChannelStatistics()),
   mPinnedForSeek(false),
   mShuttingDown(false),
   mPausedForPlaybackRateNull(false),
-  mMinimizePreroll(false),
-  mMediaTracksConstructed(false)
+  mMinimizePreroll(false)
 {
   MOZ_COUNT_CTOR(MediaDecoder);
   MOZ_ASSERT(NS_IsMainThread());
   MediaMemoryTracker::AddMediaDecoder(this);
 #ifdef PR_LOGGING
   if (!gMediaDecoderLog) {
     gMediaDecoderLog = PR_NewLogModule("MediaDecoder");
   }
@@ -694,19 +688,16 @@ void MediaDecoder::MetadataLoaded(MediaI
     // Duration has changed so we should recompute playback rate
     UpdatePlaybackRate();
   }
 
   if (mDuration == -1) {
     SetInfinite(true);
   }
 
-  mInfo = aInfo;
-  ConstructMediaTracks();
-
   if (mOwner) {
     // Make sure the element and the frame (if any) are told about
     // our new size.
     Invalidate();
     mOwner->MetadataLoaded(aInfo, aTags);
   }
 
   if (!mCalledResourceLoaded) {
@@ -1154,22 +1145,16 @@ void MediaDecoder::ChangeState(PlayState
     bool blockForPlayState = aState != PLAY_STATE_PLAYING;
     if (mDecodedStream->mHaveBlockedForPlayState != blockForPlayState) {
       mDecodedStream->mStream->ChangeExplicitBlockerCount(blockForPlayState ? 1 : -1);
       mDecodedStream->mHaveBlockedForPlayState = blockForPlayState;
     }
   }
   mPlayState = aState;
 
-  if (mPlayState == PLAY_STATE_PLAYING) {
-    ConstructMediaTracks();
-  } else if (mPlayState == PLAY_STATE_ENDED) {
-    RemoveMediaTracks();
-  }
-
   ApplyStateToStateMachine(mPlayState);
 
   if (aState!= PLAY_STATE_LOADING) {
     mIsDormant = false;
     mIsExitingDormant = false;
   }
 
   GetReentrantMonitor().NotifyAll();
@@ -1784,83 +1769,16 @@ MediaMemoryTracker::CollectReports(nsIHa
 
 MediaDecoderOwner*
 MediaDecoder::GetOwner()
 {
   MOZ_ASSERT(NS_IsMainThread());
   return mOwner;
 }
 
-void
-MediaDecoder::ConstructMediaTracks()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  if (mMediaTracksConstructed) {
-    return;
-  }
-
-  if (!mOwner || !mInfo) {
-    return;
-  }
-
-  HTMLMediaElement* element = mOwner->GetMediaElement();
-  if (!element) {
-    return;
-  }
-
-  mMediaTracksConstructed = true;
-
-  AudioTrackList* audioList = element->AudioTracks();
-  if (audioList && mInfo->HasAudio()) {
-    TrackInfo info = mInfo->mAudio.mTrackInfo;
-    nsRefPtr<AudioTrack> track = MediaTrackList::CreateAudioTrack(
-    info.mId, info.mKind, info.mLabel, info.mLanguage, info.mEnabled);
-
-    audioList->AddTrack(track);
-  }
-
-  VideoTrackList* videoList = element->VideoTracks();
-  if (videoList && mInfo->HasVideo()) {
-    TrackInfo info = mInfo->mVideo.mTrackInfo;
-    nsRefPtr<VideoTrack> track = MediaTrackList::CreateVideoTrack(
-    info.mId, info.mKind, info.mLabel, info.mLanguage);
-
-    videoList->AddTrack(track);
-    track->SetEnabledInternal(info.mEnabled, MediaTrack::FIRE_NO_EVENTS);
-  }
-}
-
-void
-MediaDecoder::RemoveMediaTracks()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  if (!mOwner) {
-    return;
-  }
-
-  HTMLMediaElement* element = mOwner->GetMediaElement();
-  if (!element) {
-    return;
-  }
-
-  AudioTrackList* audioList = element->AudioTracks();
-  if (audioList) {
-    audioList->RemoveTracks();
-  }
-
-  VideoTrackList* videoList = element->VideoTracks();
-  if (videoList) {
-    videoList->RemoveTracks();
-  }
-
-  mMediaTracksConstructed = false;
-}
-
 MediaMemoryTracker::MediaMemoryTracker()
 {
 }
 
 void
 MediaMemoryTracker::InitMemoryReporter()
 {
   RegisterWeakMemoryReporter(this);
--- a/content/media/MediaDecoder.h
+++ b/content/media/MediaDecoder.h
@@ -772,25 +772,16 @@ public:
   // the media file has been read. Call on the decode thread only.
   void OnReadMetadataCompleted() MOZ_OVERRIDE { }
 
   // Called when the metadata from the media file has been loaded by the
   // state machine. Call on the main thread only.
   virtual void MetadataLoaded(MediaInfo* aInfo,
                               MetadataTags* aTags);
 
-  // Called from MetadataLoaded(). Creates audio tracks and adds them to its
-  // owner's audio track list, and implies to video tracks respectively.
-  // Call on the main thread only.
-  void ConstructMediaTracks();
-
-  // Removes all audio tracks and video tracks that are previously added into
-  // the track list. Call on the main thread only.
-  virtual void RemoveMediaTracks() MOZ_OVERRIDE;
-
   // Called when the first frame has been loaded.
   // Call on the main thread only.
   void FirstFrameLoaded();
 
   // Returns true if the resource has been loaded. Acquires the monitor.
   // Call from any thread.
   virtual bool IsDataCachedToEndOfResource();
 
@@ -1213,21 +1204,13 @@ protected:
   // AudioStream Class.
   dom::AudioChannel mAudioChannel;
 
   // True if the decoder has been directed to minimize its preroll before
   // playback starts. After the first time playback starts, we don't attempt
   // to minimize preroll, as we assume the user is likely to keep playing,
   // or play the media again.
   bool mMinimizePreroll;
-
-  // True if audio tracks and video tracks are constructed and added into the
-  // track list, false if all tracks are removed from the track list.
-  bool mMediaTracksConstructed;
-
-  // Stores media info, including info of audio tracks and video tracks, should
-  // only be accessed from main thread.
-  nsAutoPtr<MediaInfo> mInfo;
 };
 
 } // namespace mozilla
 
 #endif
--- a/content/media/MediaInfo.h
+++ b/content/media/MediaInfo.h
@@ -4,91 +4,55 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #if !defined(MediaInfo_h)
 #define MediaInfo_h
 
 #include "nsSize.h"
 #include "nsRect.h"
 #include "ImageTypes.h"
-#include "nsString.h"
 
 namespace mozilla {
 
-struct TrackInfo {
-  void Init(const nsAString& aId,
-            const nsAString& aKind,
-            const nsAString& aLabel,
-            const nsAString& aLanguage,
-            bool aEnabled)
-  {
-    mId = aId;
-    mKind = aKind;
-    mLabel = aLabel;
-    mLanguage = aLanguage;
-    mEnabled = aEnabled;
-  }
-
-  nsString mId;
-  nsString mKind;
-  nsString mLabel;
-  nsString mLanguage;
-  bool mEnabled;
-};
-
 // Stores info relevant to presenting media frames.
 class VideoInfo {
 public:
   VideoInfo()
     : mDisplay(0,0)
     , mStereoMode(StereoMode::MONO)
     , mHasVideo(false)
-  {
-    // TODO: TrackInfo should be initialized by its specific codec decoder.
-    // This following call should be removed once we have that implemented.
-    mTrackInfo.Init(NS_LITERAL_STRING("2"), NS_LITERAL_STRING("main"),
-    EmptyString(), EmptyString(), true);
-  }
+  {}
 
   // Size in pixels at which the video is rendered. This is after it has
   // been scaled by its aspect ratio.
   nsIntSize mDisplay;
 
   // Indicates the frame layout for single track stereo videos.
   StereoMode mStereoMode;
 
   // True if we have an active video bitstream.
   bool mHasVideo;
-
-  TrackInfo mTrackInfo;
 };
 
 class AudioInfo {
 public:
   AudioInfo()
     : mRate(44100)
     , mChannels(2)
     , mHasAudio(false)
-  {
-    // TODO: TrackInfo should be initialized by its specific codec decoder.
-    // This following call should be removed once we have that implemented.
-    mTrackInfo.Init(NS_LITERAL_STRING("1"), NS_LITERAL_STRING("main"),
-    EmptyString(), EmptyString(), true);
-  }
+  {}
 
   // Sample rate.
   uint32_t mRate;
 
   // Number of audio channels.
   uint32_t mChannels;
 
   // True if we have an active audio bitstream.
   bool mHasAudio;
-
-  TrackInfo mTrackInfo;
 };
 
 class MediaInfo {
 public:
   bool HasVideo() const
   {
     return mVideo.mHasVideo;
   }
@@ -98,16 +62,15 @@ public:
     return mAudio.mHasAudio;
   }
 
   bool HasValidMedia() const
   {
     return HasVideo() || HasAudio();
   }
 
-  // TODO: Store VideoInfo and AudioIndo in arrays to support multi-tracks.
   VideoInfo mVideo;
   AudioInfo mAudio;
 };
 
 } // namespace mozilla
 
 #endif // MediaInfo_h
--- a/content/media/MediaMetadataManager.h
+++ b/content/media/MediaMetadataManager.h
@@ -41,21 +41,16 @@ namespace mozilla {
       }
       void QueueMetadata(TimedMetadata* aMetadata) {
         mMetadataQueue.insertBack(aMetadata);
       }
 
       void DispatchMetadataIfNeeded(AbstractMediaDecoder* aDecoder, double aCurrentTime) {
         TimedMetadata* metadata = mMetadataQueue.getFirst();
         while (metadata && aCurrentTime >= static_cast<double>(metadata->mPublishTime) / USECS_PER_S) {
-          // Remove all media tracks from the list first.
-          nsCOMPtr<nsIRunnable> removeTracksEvent =
-            new RemoveMediaTracksEventRunner(aDecoder);
-          NS_DispatchToMainThread(removeTracksEvent);
-
           nsCOMPtr<nsIRunnable> metadataUpdatedEvent =
             new MetadataEventRunner(aDecoder,
                                     metadata->mInfo.forget(),
                                     metadata->mTags.forget());
           NS_DispatchToMainThread(metadataUpdatedEvent);
           delete mMetadataQueue.popFirst();
           metadata = mMetadataQueue.getFirst();
         }
--- a/content/media/MediaTrackList.cpp
+++ b/content/media/MediaTrackList.cpp
@@ -100,25 +100,16 @@ MediaTrackList::AddTrack(MediaTrack* aTr
 void
 MediaTrackList::RemoveTrack(const nsRefPtr<MediaTrack>& aTrack)
 {
   mTracks.RemoveElement(aTrack);
   aTrack->SetTrackList(nullptr);
   CreateAndDispatchTrackEventRunner(aTrack, NS_LITERAL_STRING("removetrack"));
 }
 
-void
-MediaTrackList::RemoveTracks()
-{
-  while (!mTracks.IsEmpty()) {
-    nsRefPtr<MediaTrack> track = mTracks.LastElement();
-    RemoveTrack(track);
-  }
-}
-
 already_AddRefed<AudioTrack>
 MediaTrackList::CreateAudioTrack(const nsAString& aId,
                                  const nsAString& aKind,
                                  const nsAString& aLabel,
                                  const nsAString& aLanguage,
                                  bool aEnabled)
 {
   nsRefPtr<AudioTrack> track = new AudioTrack(aId, aKind, aLabel, aLanguage,
--- a/content/media/MediaTrackList.h
+++ b/content/media/MediaTrackList.h
@@ -74,18 +74,16 @@ public:
   // The return value is non-null, assert an error if aIndex is out of bound
   // for array mTracks.
   MediaTrack* operator[](uint32_t aIndex);
 
   void AddTrack(MediaTrack* aTrack);
 
   void RemoveTrack(const nsRefPtr<MediaTrack>& aTrack);
 
-  void RemoveTracks();
-
   static already_AddRefed<AudioTrack>
   CreateAudioTrack(const nsAString& aId,
                    const nsAString& aKind,
                    const nsAString& aLabel,
                    const nsAString& aLanguage,
                    bool aEnabled);
 
   static already_AddRefed<VideoTrack>
--- a/content/media/test/mochitest.ini
+++ b/content/media/test/mochitest.ini
@@ -374,19 +374,17 @@ skip-if = buildapp == 'b2g' || toolkit =
 [test_mediarecorder_record_nosrc.html]
 [test_mediarecorder_record_session.html]
 [test_mediarecorder_record_startstopstart.html]
 [test_mediarecorder_record_stopms.html]
 [test_mediarecorder_record_timeslice.html]
 [test_mediarecorder_reload_crash.html]
 [test_mediarecorder_unsupported_src.html]
 [test_mediarecorder_record_getdata_afterstart.html]
-[test_mediatrack_consuming_mediaresource.html]
 [test_mediatrack_events_and_consuming_ms.html]
-[test_mediatrack_replay_from_end.html]
 [test_metadata.html]
 [test_mixed_principals.html]
 skip-if = true # bug 567954 and intermittent leaks
 [test_mozHasAudio.html]
 [test_networkState.html]
 [test_new_audio.html]
 [test_no_load_event.html]
 [test_paused.html]
deleted file mode 100644
--- a/content/media/test/test_mediatrack_consuming_mediaresource.html
+++ /dev/null
@@ -1,175 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test track interfaces when consuming media resources</title>
-  <script type="text/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>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-var manager = new MediaTestManager;
-
-function startTest(test, token) {
-  var elemType = getMajorMimeType(test.type);
-  var element = document.createElement(elemType);
-
-  var audioOnchange = 0;
-  var audioOnaddtrack = 0;
-  var audioOnremovetrack = 0;
-  var videoOnchange = 0;
-  var videoOnaddtrack = 0;
-  var videoOnremovetrack = 0;
-  var isPlaying = false;
-
-  isnot(element.audioTracks, undefined,
-        'HTMLMediaElement::AudioTracks() property should be available.');
-  isnot(element.videoTracks, undefined,
-        'HTMLMediaElement::VideoTracks() property should be available.');
-
-  element.audioTracks.onaddtrack = function(e) {
-    audioOnaddtrack++;
-  }
-
-  element.audioTracks.onremovetrack = function(e) {
-    audioOnremovetrack++;
-  }
-
-  element.audioTracks.onchange = function(e) {
-    audioOnchange++;
-  }
-
-  element.videoTracks.onaddtrack = function(e) {
-    videoOnaddtrack++;
-  }
-
-  element.videoTracks.onremovetrack = function(e) {
-    videoOnremovetrack++;
-  }
-
-  element.videoTracks.onchange = function(e) {
-    videoOnchange++;
-  }
-
-  function checkTrackRemoved() {
-    if (isPlaying) {
-      if (test.hasAudio) {
-        is(audioOnremovetrack, 1, 'Calls of onremovetrack on audioTracks should be 1.');
-        is(element.audioTracks.length, 0, 'The length of audioTracks should be 0.');
-      }
-      if (test.hasVideo) {
-        is(videoOnremovetrack, 1, 'Calls of onremovetrack on videoTracks should be 1.');
-        is(element.videoTracks.length, 0, 'The length of videoTracks should be 0.');
-      }
-    }
-  }
-
-  function onended() {
-    ok(true, 'Event ended is expected to be fired on element.');
-    checkTrackRemoved();
-    element.onended = null;
-    element.onplaying = null;
-    element.onpause = null;
-    manager.finished(element.token);
-  }
-
-  function checkTrackAdded() {
-    isPlaying = true;
-    if (test.hasAudio) {
-      is(audioOnaddtrack, 1, 'Calls of onaddtrack on audioTracks should be 1.');
-      is(element.audioTracks.length, 1, 'The length of audioTracks should be 1.');
-      ok(element.audioTracks[0].enabled, 'Audio track should be enabled as default.');
-    }
-    if (test.hasVideo) {
-      is(videoOnaddtrack, 1, 'Calls of onaddtrack on videoTracks should be 1.');
-      is(element.videoTracks.length, 1, 'The length of videoTracks should be 1.');
-      is(element.videoTracks.selectedIndex, 0,
-         'The first video track is set selected as default.');
-    }
-  }
-
-  function setTrackEnabled(enabled) {
-    if (test.hasAudio) {
-      element.audioTracks[0].enabled = enabled;
-    }
-    if (test.hasVideo) {
-      element.videoTracks[0].selected = enabled;
-    }
-  }
-
-  function checkTrackChanged(calls, enabled) {
-    if (test.hasAudio) {
-      is(audioOnchange, calls, 'Calls of onchange on audioTracks should be '+calls);
-      is(element.audioTracks[0].enabled, enabled,
-         'Enabled value of the audio track should be ' +enabled);
-    }
-    if (test.hasVideo) {
-      is(videoOnchange, calls, 'Calls of onchange on videoTracks should be '+calls);
-      is(element.videoTracks[0].selected, enabled,
-         'Selected value of the video track should be ' +enabled);
-      var index = enabled ? 0 : -1;
-      is(element.videoTracks.selectedIndex, index,
-         'SelectedIndex of video tracks should be ' +index);
-    }
-  }
-
-  function onpause() {
-    element.onpause = null;
-    if (steps == 1) {
-      setTrackEnabled(false);
-      element.onplaying = onplaying;
-      element.play();
-      steps++;
-    } else if (steps == 2) {
-      setTrackEnabled(true);
-      element.onplaying = onplaying;
-      element.play();
-      steps++;
-    }
-  }
-
-  function onplaying() {
-    element.onplaying = null;
-    if (steps == 1) {
-      element.onpause = onpause;
-      element.pause();
-      checkTrackAdded();
-    } else if (steps == 2) {
-      element.onpause = onpause;
-      element.pause();
-      checkTrackChanged(1, false);
-    } else if (steps == 3) {
-      checkTrackChanged(2, true);
-    }
-  }
-
-  var steps = 0;
-
-  element.token = token;
-  manager.started(token);
-
-  element.src = test.name;
-  element.test = test;
-  element.onplaying = onplaying;
-  element.onended = onended;
-  element.play();
-  steps++;
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPrefEnv(
-  {
-    "set": [
-      ["media.track.enabled", true]
-    ]
-  },
-  function() {
-    manager.runTests(gTrackTests, startTest);
-  });
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/content/media/test/test_mediatrack_replay_from_end.html
+++ /dev/null
@@ -1,146 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test media tracks if replay after playback has ended</title>
-  <script type="text/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>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-var manager = new MediaTestManager;
-
-function startTest(test, token) {
-  // Scenario to test:
-  // 1. Audio tracks and video tracks should be added to the track list when
-  //    playing, and all tracks should be removed from the list after we seek
-  //    to the end.
-  // 2. All tracks should be added back to the list if we replay from the end,
-  //    and all tracks should be removed from the list after we seek to the end.
-  // 3. After seek to the middle from end of playback, all tracks should be
-  //    added back to the list if we play from here, and all tracks should be
-  //    removed from the list after we seek to the end.
-
-  var elemType = getMajorMimeType(test.type);
-  var element = document.createElement(elemType);
-
-  var audioOnchange = 0;
-  var audioOnaddtrack = 0;
-  var audioOnremovetrack = 0;
-  var videoOnchange = 0;
-  var videoOnaddtrack = 0;
-  var videoOnremovetrack = 0;
-  var isPlaying = false;
-  var steps = 0;
-
-  element.audioTracks.onaddtrack = function(e) {
-    audioOnaddtrack++;
-  }
-
-  element.audioTracks.onremovetrack = function(e) {
-    audioOnremovetrack++;
-  }
-
-  element.videoTracks.onaddtrack = function(e) {
-    videoOnaddtrack++;
-  }
-
-  element.videoTracks.onremovetrack = function(e) {
-    videoOnremovetrack++;
-  }
-
-  function testTrackEventCalls(expectedCalls) {
-    if (test.hasAudio) {
-      is(audioOnaddtrack, expectedCalls,
-         'Calls of onaddtrack on audioTracks should be '+expectedCalls+' times.');
-      is(audioOnremovetrack, expectedCalls,
-         'Calls of onremovetrack on audioTracks should be '+expectedCalls+' times.');
-    }
-    if (test.hasVideo) {
-      is(videoOnaddtrack, expectedCalls,
-         'Calls of onaddtrack on videoTracks should be '+expectedCalls+' times.');
-      is(videoOnremovetrack, expectedCalls,
-         'Calls of onremovetrack on videoTracks should be '+expectedCalls+' times.');
-    }
-  }
-
-  function finishTesting() {
-    element.onpause = null;
-    element.onseeked = null;
-    element.onplaying = null;
-    element.onended = null;
-    manager.finished(element.token);
-  }
-
-  function onended() {
-    if (isPlaying) {
-      switch(steps) {
-        case 1:
-          testTrackEventCalls(1);
-          element.onplaying = onplaying;
-          element.play();
-          steps++;
-          break;
-        case 2:
-          testTrackEventCalls(2);
-          element.currentTime = element.duration * 0.5;
-          element.onplaying = onplaying;
-          element.play();
-          steps++;
-          break;
-        case 3:
-          testTrackEventCalls(3);
-          finishTesting();
-          break;
-      }
-    } else {
-      ok(true, 'Finish the test anyway if ended is fired before other events.');
-      finishTesting();
-    }
-  }
-
-  function seekToEnd() {
-    element.onpause = null;
-    element.currentTime = element.duration * 1.1;
-  }
-
-  function onseeked() {
-    element.onseeked = null;
-    element.onpause = seekToEnd;
-    element.pause();
-  }
-
-  function onplaying() {
-    isPlaying = true;
-    element.onplaying = null;
-    element.onseeked = onseeked;
-  }
-
-  element.token = token;
-  manager.started(token);
-
-  element.src = test.name;
-  element.test = test;
-  element.onplaying = onplaying;
-  element.onended = onended;
-  element.play();
-  steps++;
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPrefEnv(
-  {
-    "set": [
-      ["media.track.enabled", true]
-    ]
-  },
-  function() {
-    manager.runTests(gTrackTests, startTest);
-  });
-
-</script>
-</pre>
-</body>
-</html>