Backed out 3 changesets (bug 1161276) for test_mediarecorder_bitrate.html failures CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Thu, 17 Sep 2015 13:06:41 -0700
changeset 297394 9442eb6fda7eb4dcd119559bf837558c07beccea
parent 297393 ab174fa288a344e4cd48969f5935b81961583c10
child 297395 9c45ef119f96d3cbda6bde12c11c594aa7f60d8c
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1161276
milestone43.0a1
backs out9187f4d2518fcba32aaa124ea1c0abff397f0a64
4e8f28b173005afe52592738e8848d56f6a3a54d
cf05881e89ed313051a69a3e18e5c06c8bd909b5
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 3 changesets (bug 1161276) for test_mediarecorder_bitrate.html failures CLOSED TREE Backed out changeset 9187f4d2518f (bug 1161276) Backed out changeset 4e8f28b17300 (bug 1161276) Backed out changeset cf05881e89ed (bug 1161276)
dom/media/MediaRecorder.cpp
dom/media/MediaRecorder.h
dom/media/encoder/MediaEncoder.cpp
dom/media/encoder/MediaEncoder.h
dom/media/encoder/OpusTrackEncoder.cpp
dom/media/encoder/TrackEncoder.h
dom/media/encoder/VP8TrackEncoder.cpp
dom/media/encoder/VorbisTrackEncoder.cpp
dom/media/test/manifest.js
dom/media/test/mochitest.ini
dom/media/test/test_mediarecorder_bitrate.html
dom/webidl/MediaRecorder.webidl
--- a/dom/media/MediaRecorder.cpp
+++ b/dom/media/MediaRecorder.cpp
@@ -590,27 +590,19 @@ private:
       LOG(LogLevel::Debug, ("Session.InitEncoder failure, mRecorder is null %p", this));
       return;
     }
     // Allocate encoder and bind with union stream.
     // At this stage, the API doesn't allow UA to choose the output mimeType format.
 
     // Make sure the application has permission to assign AUDIO_3GPP
     if (mRecorder->mMimeType.EqualsLiteral(AUDIO_3GPP) && Check3gppPermission()) {
-      mEncoder = MediaEncoder::CreateEncoder(NS_LITERAL_STRING(AUDIO_3GPP),
-                                             mRecorder->GetAudioBitrate(),
-                                             mRecorder->GetVideoBitrate(),
-                                             mRecorder->GetBitrate(),
-                                             aTrackTypes);
+      mEncoder = MediaEncoder::CreateEncoder(NS_LITERAL_STRING(AUDIO_3GPP), aTrackTypes);
     } else {
-      mEncoder = MediaEncoder::CreateEncoder(NS_LITERAL_STRING(""),
-                                             mRecorder->GetAudioBitrate(),
-                                             mRecorder->GetVideoBitrate(),
-                                             mRecorder->GetBitrate(),
-                                             aTrackTypes);
+      mEncoder = MediaEncoder::CreateEncoder(NS_LITERAL_STRING(""), aTrackTypes);
     }
 
     if (!mEncoder) {
       LOG(LogLevel::Debug, ("Session.InitEncoder !mEncoder %p", this));
       DoSessionEndTask(NS_ERROR_ABORT);
       return;
     }
 
@@ -968,17 +960,17 @@ MediaRecorder::Constructor(const GlobalO
 {
   nsCOMPtr<nsPIDOMWindow> ownerWindow = do_QueryInterface(aGlobal.GetAsSupports());
   if (!ownerWindow) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   nsRefPtr<MediaRecorder> object = new MediaRecorder(aStream, ownerWindow);
-  object->SetOptions(aInitDict);
+  object->SetMimeType(aInitDict.mMimeType);
   return object.forget();
 }
 
 /* static */ already_AddRefed<MediaRecorder>
 MediaRecorder::Constructor(const GlobalObject& aGlobal,
                            AudioNode& aSrcAudioNode,
                            uint32_t aSrcOutput,
                            const MediaRecorderOptions& aInitDict,
@@ -1004,43 +996,20 @@ MediaRecorder::Constructor(const GlobalO
        aSrcOutput >= aSrcAudioNode.NumberOfOutputs()) {
     aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
     return nullptr;
   }
 
   nsRefPtr<MediaRecorder> object = new MediaRecorder(aSrcAudioNode,
                                                      aSrcOutput,
                                                      ownerWindow);
-  object->SetOptions(aInitDict);
+  object->SetMimeType(aInitDict.mMimeType);
   return object.forget();
 }
 
-void
-MediaRecorder::SetOptions(const MediaRecorderOptions& aInitDict)
-{
-  SetMimeType(aInitDict.mMimeType);
-  mAudioBitsPerSecond = aInitDict.mAudioBitsPerSecond.WasPassed() ?
-                        aInitDict.mAudioBitsPerSecond.Value() : 0;
-  mVideoBitsPerSecond = aInitDict.mVideoBitsPerSecond.WasPassed() ?
-                        aInitDict.mVideoBitsPerSecond.Value() : 0;
-  mBitsPerSecond = aInitDict.mBitsPerSecond.WasPassed() ?
-                   aInitDict.mBitsPerSecond.Value() : 0;
-  // We're not handling dynamic changes yet. Eventually we'll handle
-  // setting audio, video and/or total -- and anything that isn't set,
-  // we'll derive. Calculated versions require querying bitrates after
-  // the encoder is Init()ed. This happens only after data is
-  // available and thus requires dynamic changes.
-  //
-  // Until dynamic changes are supported, I prefer to be safe and err
-  // slightly high
-  if (aInitDict.mBitsPerSecond.WasPassed() && !aInitDict.mVideoBitsPerSecond.WasPassed()) {
-    mVideoBitsPerSecond = mBitsPerSecond;
-  }
-}
-
 nsresult
 MediaRecorder::CreateAndDispatchBlobEvent(already_AddRefed<nsIDOMBlob>&& aBlob)
 {
   MOZ_ASSERT(NS_IsMainThread(), "Not running on main thread");
   if (!CheckPrincipal()) {
     // Media is not same-origin, don't allow the data out.
     nsRefPtr<nsIDOMBlob> blob = aBlob;
     return NS_ERROR_DOM_SECURITY_ERR;
--- a/dom/media/MediaRecorder.h
+++ b/dom/media/MediaRecorder.h
@@ -99,34 +99,30 @@ public:
   IMPL_EVENT_HANDLER(dataavailable)
   IMPL_EVENT_HANDLER(error)
   IMPL_EVENT_HANDLER(start)
   IMPL_EVENT_HANDLER(stop)
   IMPL_EVENT_HANDLER(warning)
 
   NS_DECL_NSIDOCUMENTACTIVITY
 
-  uint32_t GetAudioBitrate() { return mAudioBitsPerSecond; }
-  uint32_t GetVideoBitrate() { return mVideoBitsPerSecond; }
-  uint32_t GetBitrate() { return mBitsPerSecond; }
 protected:
   virtual ~MediaRecorder();
 
   MediaRecorder& operator = (const MediaRecorder& x) = delete;
   // Create dataavailable event with Blob data and it runs in main thread
   nsresult CreateAndDispatchBlobEvent(already_AddRefed<nsIDOMBlob>&& aBlob);
   // Creating a simple event to notify UA simple event.
   void DispatchSimpleEvent(const nsAString & aStr);
   // Creating a error event with message.
   void NotifyError(nsresult aRv);
   // Check if the recorder's principal is the subsume of mediaStream
   bool CheckPrincipal();
   // Set encoded MIME type.
   void SetMimeType(const nsString &aMimeType);
-  void SetOptions(const MediaRecorderOptions& aInitDict);
 
   MediaRecorder(const MediaRecorder& x) = delete; // prevent bad usage
   // Remove session pointer.
   void RemoveSession(Session* aSession);
   // Functions for Session to query input source info.
   MediaStream* GetSourceMediaStream();
   nsIPrincipal* GetSourcePrincipal();
   // DOM wrapper for source media stream. Will be null when input is audio node.
@@ -143,19 +139,16 @@ protected:
   // The current state of the MediaRecorder object.
   RecordingState mState;
   // Hold the sessions reference and clean it when the DestroyRunnable for a
   // session is running.
   nsTArray<nsRefPtr<Session> > mSessions;
   // It specifies the container format as well as the audio and video capture formats.
   nsString mMimeType;
 
-  uint32_t mAudioBitsPerSecond;
-  uint32_t mVideoBitsPerSecond;
-  uint32_t mBitsPerSecond;
 private:
   // Register MediaRecorder into Document to listen the activity changes.
   void RegisterActivityObserver();
   void UnRegisterActivityObserver();
 
   bool Check3gppPermission();
 };
 
--- a/dom/media/encoder/MediaEncoder.cpp
+++ b/dom/media/encoder/MediaEncoder.cpp
@@ -68,19 +68,17 @@ MediaEncoder::NotifyEvent(MediaStreamGra
   }
   if (mVideoEncoder) {
     mVideoEncoder->NotifyEvent(aGraph, event);
   }
 }
 
 /* static */
 already_AddRefed<MediaEncoder>
-MediaEncoder::CreateEncoder(const nsAString& aMIMEType, uint32_t aAudioBitrate,
-                            uint32_t aVideoBitrate, uint32_t aBitrate,
-                            uint8_t aTrackTypes)
+MediaEncoder::CreateEncoder(const nsAString& aMIMEType, uint8_t aTrackTypes)
 {
   if (!gMediaEncoderLog) {
     gMediaEncoderLog = PR_NewLogModule("MediaEncoder");
   }
   PROFILER_LABEL("MediaEncoder", "CreateEncoder",
     js::ProfileEntry::Category::OTHER);
 
   nsAutoPtr<ContainerWriter> writer;
@@ -141,25 +139,18 @@ MediaEncoder::CreateEncoder(const nsAStr
   }
   else {
     LOG(LogLevel::Error, ("Can not find any encoder to record this media stream"));
     return nullptr;
   }
   LOG(LogLevel::Debug, ("Create encoder result:a[%d] v[%d] w[%d] mimeType = %s.",
                       audioEncoder != nullptr, videoEncoder != nullptr,
                       writer != nullptr, mimeType.get()));
-  if (videoEncoder && aVideoBitrate != 0) {
-    videoEncoder->SetBitrate(aVideoBitrate);
-  }
-  if (audioEncoder && aAudioBitrate != 0) {
-    audioEncoder->SetBitrate(aAudioBitrate);
-  }
   encoder = new MediaEncoder(writer.forget(), audioEncoder.forget(),
-                             videoEncoder.forget(), mimeType, aAudioBitrate,
-                             aVideoBitrate, aBitrate);
+                             videoEncoder.forget(), mimeType);
   return encoder.forget();
 }
 
 /**
  * GetEncodedData() runs as a state machine, starting with mState set to
  * GET_METADDATA, the procedure should be as follow:
  *
  * While non-stop
--- a/dom/media/encoder/MediaEncoder.h
+++ b/dom/media/encoder/MediaEncoder.h
@@ -57,20 +57,17 @@ public :
     ENCODE_TRACK,
     ENCODE_DONE,
     ENCODE_ERROR,
   };
 
   MediaEncoder(ContainerWriter* aWriter,
                AudioTrackEncoder* aAudioEncoder,
                VideoTrackEncoder* aVideoEncoder,
-               const nsAString& aMIMEType,
-               uint32_t aAudioBitrate,
-               uint32_t aVideoBitrate,
-               uint32_t aBitrate)
+               const nsAString& aMIMEType)
     : mWriter(aWriter)
     , mAudioEncoder(aAudioEncoder)
     , mVideoEncoder(aVideoEncoder)
     , mStartTime(TimeStamp::Now())
     , mMIMEType(aMIMEType)
     , mSizeOfBuffer(0)
     , mState(MediaEncoder::ENCODE_METADDATA)
     , mShutdown(false)
@@ -94,18 +91,16 @@ public :
                            MediaStreamListener::MediaStreamGraphEvent event) override;
 
   /**
    * Creates an encoder with a given MIME type. Returns null if we are unable
    * to create the encoder. For now, default aMIMEType to "audio/ogg" and use
    * Ogg+Opus if it is empty.
    */
   static already_AddRefed<MediaEncoder> CreateEncoder(const nsAString& aMIMEType,
-                                                      uint32_t aAudioBitrate, uint32_t aVideoBitrate,
-                                                      uint32_t aBitrate,
                                                       uint8_t aTrackTypes = ContainerWriter::CREATE_AUDIO_TRACK);
   /**
    * Encodes the raw track data and returns the final container data. Assuming
    * it is called on a single worker thread. The buffer of container data is
    * allocated in ContainerWriter::GetContainerData(), and is appended to
    * aOutputBufs. aMIMEType is the valid mime-type of this returned container
    * data.
    */
--- a/dom/media/encoder/OpusTrackEncoder.cpp
+++ b/dom/media/encoder/OpusTrackEncoder.cpp
@@ -182,23 +182,18 @@ OpusTrackEncoder::Init(int aChannels, in
   }
   mSamplingRate = aSamplingRate;
   NS_ENSURE_TRUE(mSamplingRate > 0, NS_ERROR_FAILURE);
 
   int error = 0;
   mEncoder = opus_encoder_create(GetOutputSampleRate(), mChannels,
                                  OPUS_APPLICATION_AUDIO, &error);
 
-
   mInitialized = (error == OPUS_OK);
 
-  if (mAudioBitrate) {
-    opus_encoder_ctl(mEncoder, OPUS_SET_BITRATE(static_cast<int>(mAudioBitrate)));
-  }
-
   mReentrantMonitor.NotifyAll();
 
   return error == OPUS_OK ? NS_OK : NS_ERROR_FAILURE;
 }
 
 int
 OpusTrackEncoder::GetOutputSampleRate()
 {
--- a/dom/media/encoder/TrackEncoder.h
+++ b/dom/media/encoder/TrackEncoder.h
@@ -79,18 +79,16 @@ public:
    */
   void NotifyCancel()
   {
     ReentrantMonitorAutoEnter mon(mReentrantMonitor);
     mCanceled = true;
     mReentrantMonitor.NotifyAll();
   }
 
-  virtual void SetBitrate(const uint32_t aBitrate) {}
-
 protected:
   /**
    * Notifies track encoder that we have reached the end of source stream, and
    * wakes up mReentrantMonitor if encoder is waiting for any source data.
    */
   virtual void NotifyEndOfStream() = 0;
 
   /**
@@ -138,17 +136,16 @@ protected:
 
 class AudioTrackEncoder : public TrackEncoder
 {
 public:
   AudioTrackEncoder()
     : TrackEncoder()
     , mChannels(0)
     , mSamplingRate(0)
-    , mAudioBitrate(0)
   {}
 
   virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
                                         StreamTime aTrackOffset,
                                         uint32_t aTrackEvents,
                                         const MediaSegment& aQueuedMedia) override;
 
   template<typename T>
@@ -189,20 +186,16 @@ public:
    */
   static void DeInterleaveTrackData(AudioDataValue* aInput, int32_t aDuration,
                                     int32_t aChannels, AudioDataValue* aOutput);
   /**
   * Measure size of mRawSegment
   */
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
-  virtual void SetBitrate(const uint32_t aBitrate) override
-  {
-    mAudioBitrate = aBitrate;
-  }
 protected:
   /**
    * Number of samples per channel in a pcm buffer. This is also the value of
    * frame size required by audio encoder, and mReentrantMonitor will be
    * notified when at least this much data has been added to mRawSegment.
    */
   virtual int GetPacketDuration() { return 0; }
 
@@ -241,51 +234,44 @@ protected:
    * The sampling rate of source audio data.
    */
   int mSamplingRate;
 
   /**
    * A segment queue of audio track data, protected by mReentrantMonitor.
    */
   AudioSegment mRawSegment;
-
-  uint32_t mAudioBitrate;
 };
 
 class VideoTrackEncoder : public TrackEncoder
 {
 public:
   VideoTrackEncoder()
     : TrackEncoder()
     , mFrameWidth(0)
     , mFrameHeight(0)
     , mDisplayWidth(0)
     , mDisplayHeight(0)
     , mTrackRate(0)
     , mTotalFrameDuration(0)
-    , mVideoBitrate(0)
   {}
 
   /**
    * Notified by the same callback of MediaEncoder when it has received a track
    * change from MediaStreamGraph. Called on the MediaStreamGraph thread.
    */
   virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
                                         StreamTime aTrackOffset,
                                         uint32_t aTrackEvents,
                                         const MediaSegment& aQueuedMedia) override;
   /**
   * Measure size of mRawSegment
   */
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
-  virtual void SetBitrate(const uint32_t aBitrate) override
-  {
-    mVideoBitrate = aBitrate;
-  }
 protected:
   /**
    * Initialized the video encoder. In order to collect the value of width and
    * height of source frames, this initialization is delayed until we have
    * received the first valid video frame from MediaStreamGraph;
    * mReentrantMonitor will be notified after it has successfully initialized,
    * and this method is called on the MediaStramGraph thread.
    */
@@ -341,15 +327,13 @@ protected:
    * subclasses.
    */
   VideoFrame mLastFrame;
 
   /**
    * A segment queue of audio track data, protected by mReentrantMonitor.
    */
   VideoSegment mRawSegment;
-
-  uint32_t mVideoBitrate;
 };
 
 } // namespace mozilla
 
 #endif
--- a/dom/media/encoder/VP8TrackEncoder.cpp
+++ b/dom/media/encoder/VP8TrackEncoder.cpp
@@ -15,17 +15,17 @@
 
 namespace mozilla {
 
 PRLogModuleInfo* gVP8TrackEncoderLog;
 #define VP8LOG(msg, ...) MOZ_LOG(gVP8TrackEncoderLog, mozilla::LogLevel::Debug, \
                                   (msg, ##__VA_ARGS__))
 // Debug logging macro with object pointer and class name.
 
-#define DEFAULT_BITRATE_BPS 2500000
+#define DEFAULT_BITRATE 2500 // in kbit/s
 #define DEFAULT_ENCODE_FRAMERATE 30
 
 using namespace mozilla::layers;
 
 VP8TrackEncoder::VP8TrackEncoder()
   : VideoTrackEncoder()
   , mEncodedFrameDuration(0)
   , mEncodedTimestamp(0)
@@ -82,19 +82,17 @@ VP8TrackEncoder::Init(int32_t aWidth, in
   // (actual memory is not allocated).
   vpx_img_wrap(mVPXImageWrapper, VPX_IMG_FMT_I420,
                mFrameWidth, mFrameHeight, 1, nullptr);
 
   config.g_w = mFrameWidth;
   config.g_h = mFrameHeight;
   // TODO: Maybe we should have various aFrameRate bitrate pair for each devices?
   // or for different platform
-
-  // rc_target_bitrate needs kbit/s
-  config.rc_target_bitrate = (mVideoBitrate != 0 ? mVideoBitrate : DEFAULT_BITRATE_BPS)/1000;
+  config.rc_target_bitrate = DEFAULT_BITRATE; // in kbit/s
 
   // Setting the time base of the codec
   config.g_timebase.num = 1;
   config.g_timebase.den = mTrackRate;
 
   config.g_error_resilient = 0;
 
   config.g_lag_in_frames = 0; // 0- no frame lagging
--- a/dom/media/encoder/VorbisTrackEncoder.cpp
+++ b/dom/media/encoder/VorbisTrackEncoder.cpp
@@ -51,22 +51,19 @@ VorbisTrackEncoder::Init(int aChannels, 
   // This monitor is used to wake up other methods that are waiting for encoder
   // to be completely initialized.
   ReentrantMonitorAutoEnter mon(mReentrantMonitor);
   mChannels = aChannels;
   mSamplingRate = aSamplingRate;
 
   int ret = 0;
   vorbis_info_init(&mVorbisInfo);
-  double quality = mAudioBitrate ? (double)mAudioBitrate/aSamplingRate :
-                   BASE_QUALITY;
 
-  printf("quality %f \n", quality);
   ret = vorbis_encode_init_vbr(&mVorbisInfo, mChannels, mSamplingRate,
-                               quality);
+                               BASE_QUALITY);
 
   mInitialized = (ret == 0);
 
   if (mInitialized) {
     // Set up the analysis state and auxiliary encoding storage
     vorbis_analysis_init(&mVorbisDsp, &mVorbisInfo);
     vorbis_block_init(&mVorbisDsp, &mVorbisBlock);
   }
--- a/dom/media/test/manifest.js
+++ b/dom/media/test/manifest.js
@@ -121,21 +121,16 @@ var gClosingConnectionsTest = [
 ];
 
 // Used by any media recorder test. Need one test file per decoder backend
 // currently supported by the media encoder.
 var gMediaRecorderTests = [
   { name:"detodos.opus", type:"audio/ogg; codecs=opus", duration:2.9135 }
 ];
 
-// Used by video media recorder tests
-var gMediaRecorderVideoTests = [
-  { name:"seek.webm", type:"video/webm", width:320, height:240, duration:3.966 },
-];
-
 // These are files that we want to make sure we can play through.  We can
 // also check metadata.  Put files of the same type together in this list so if
 // something crashes we have some idea of which backend is responsible.
 // Used by test_playback, which expects no error event and one ended event.
 var gPlayTests = [
   // Test playback of a WebM file with vp9 video
   //{ name:"vp9.webm", type:"video/webm", duration:4 },
   { name:"vp9cake.webm", type:"video/webm", duration:7.966 },
--- a/dom/media/test/mochitest.ini
+++ b/dom/media/test/mochitest.ini
@@ -658,18 +658,16 @@ skip-if = (toolkit == 'android' && proce
 [test_loop.html]
 skip-if = (toolkit == 'android' && processor == 'x86') #x86 only bug 914439
 [test_media_selection.html]
 skip-if = (toolkit == 'android' && processor == 'x86') #x86 only bug 914439
 [test_media_sniffer.html]
 skip-if = (toolkit == 'android' && processor == 'x86') #x86 only bug 914439
 [test_mediarecorder_avoid_recursion.html]
 tags=msg
-[test_mediarecorder_bitrate.html]
-tags=msg
 [test_mediarecorder_creation.html]
 tags=msg capturestream
 [test_mediarecorder_creation_fail.html]
 tags=msg
 [test_mediarecorder_getencodeddata.html]
 tags=msg
 [test_mediarecorder_record_4ch_audiocontext.html]
 tags=msg
deleted file mode 100644
--- a/dom/media/test/test_mediarecorder_bitrate.html
+++ /dev/null
@@ -1,131 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test MediaRecorder Record No Timeslice</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;
-var results = [];
-
-/**
- * Starts a test on every media recorder file included to check that a
- * stream derived from the file can be recorded with no time slice provided.
- */
-function startTest(test, token) {
-  manager.started(token);
-  runTest(test, token, 1000000);
-  runTest(test, token, 100000);
-}
-
-function runTest(test, token, bitrate) {
-  var element = document.createElement('video');
-  var expectedMimeType = test.type.substring(0, test.type.indexOf(';'));
-
-  element.token = token;
-
-  element.src = test.name;
-  element.test = test;
-  element.stream = element.mozCaptureStreamUntilEnded();
-
-  var mediaRecorder = new MediaRecorder(element.stream , {videoBitsPerSecond: bitrate});
-  var onStopFired = false;
-  var onDataAvailableFired = false;
-  var encoded_size = 0;
-
-  mediaRecorder.onerror = function () {
-    ok(false, 'Unexpected onerror callback fired');
-  };
-
-  mediaRecorder.onwarning = function () {
-    ok(false, 'Unexpected onwarning callback fired');
-  };
-
-  // This handler verifies that only a single onstop event handler is fired.
-  mediaRecorder.onstop = function () {
-    if (onStopFired) {
-      ok(false, 'onstop unexpectedly fired more than once');
-    } else {
-      onStopFired = true;
-
-      // ondataavailable should always fire before onstop
-      if (onDataAvailableFired) {
-        ok(true, 'onstop fired after ondataavailable');
-        info("test " + test.name + " encoded@" + bitrate + "=" + encoded_size);
-        if (results[test.name]) {
-          var big, small, temp;
-          big = {};
-	  big.bitrate = bitrate;
-	  big.size = encoded_size;
-	  small = results[test.name];
-	  // Don't assume the order that these will finish in
-	  if (results[test.name].bitrate > bitrate) {
-	    temp = big;
-	    big = small;
-	    small = temp;
-	  }
-	  // Ensure there is a big enough difference in the encoded
-	  // sizes
-          ok(small.size*1.25 < big.size,
-	     test.name + ' encoded@' + big.bitrate + '=' + big.size +
-	     ' > encoded@' + small.bitrate + '=' + small.size);
-          manager.finished(token);
-        } else {
-	  results[test.name] = {};
-	  results[test.name].bitrate = bitrate;
-          results[test.name].size = encoded_size;
-        }
-      } else {
-        ok(false, 'onstop fired without an ondataavailable event first');
-      }
-    }
-  };
-
-  // This handler verifies that only a single ondataavailable event handler
-  // is fired with the blob generated having greater than zero size
-  // and a correct mime type.
-  mediaRecorder.ondataavailable = function (evt) {
-    if (onDataAvailableFired) {
-      ok(false, 'ondataavailable unexpectedly fired more than once');
-    } else {
-      onDataAvailableFired = true;
-
-      ok(evt instanceof BlobEvent,
-         'Events fired from ondataavailable should be BlobEvent');
-      is(evt.type, 'dataavailable',
-         'Event type should dataavailable');
-      ok(evt.data.size > 0,
-         'Blob data received should be greater than zero');
-      encoded_size = evt.data.size;
-
-      // onstop should not have fired before ondataavailable
-      if (onStopFired) {
-        ok(false, 'ondataavailable unexpectedly fired later than onstop');
-        manager.finished(token);
-      }
-    }
-  };
-
-  element.preload = "metadata";
-
-  element.onloadedmetadata = function () {
-    element.onloadedmetadata = null;
-    mediaRecorder.start();
-    is(mediaRecorder.state, 'recording',
-     'Media recorder should be recording');
-    is(mediaRecorder.stream, element.stream,
-     'Media recorder stream = element stream at the start of recording');
-
-    element.play();
-  }
-}
-
-manager.runTests(gMediaRecorderVideoTests, startTest);
-</script>
-</pre>
-</body>
-</html>
--- a/dom/webidl/MediaRecorder.webidl
+++ b/dom/webidl/MediaRecorder.webidl
@@ -46,12 +46,9 @@ interface MediaRecorder : EventTarget {
   void resume();
 
   [Throws]
   void requestData();
 };
 
 dictionary MediaRecorderOptions {
   DOMString mimeType = ""; // Default encoding mimeType.
-  unsigned long audioBitsPerSecond;
-  unsigned long videoBitsPerSecond;
-  unsigned long bitsPerSecond;
 };