Backed out 5 changesets (bug 1302632) for forthcoming failures
authorPhil Ringnalda <philringnalda@gmail.com>
Thu, 15 Sep 2016 21:39:00 -0700
changeset 314157 3172114c06cdf084d9e46c394c47e62c672c7259
parent 314156 f2ced742d6aada6565d91170c32d3bb579b54387
child 314167 23cd4d6ba00c1139175eaa82d22b70d1172d76cf
child 314203 49e110586b98da92bca64b3f9c7c55b017afbce9
push id30708
push usercbook@mozilla.com
push dateFri, 16 Sep 2016 10:52:07 +0000
treeherdermozilla-central@3172114c06cd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1302632
milestone51.0a1
backs outf2ced742d6aada6565d91170c32d3bb579b54387
55e7962d4fc010a42610ada8806bc566b7e51c4e
b20f7c887e6c2525e7fabfeb63dd996f0cd7f163
22772e4a9c722ff9ff071ecb2c8de362d8c1f77d
7d7558864a662be6535d4a52054b6dc0bf9c5fc7
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 5 changesets (bug 1302632) for forthcoming failures Backed out changeset f2ced742d6aa (bug 1302632) Backed out changeset 55e7962d4fc0 (bug 1302632) Backed out changeset b20f7c887e6c (bug 1302632) Backed out changeset 22772e4a9c72 (bug 1302632) Backed out changeset 7d7558864a66 (bug 1302632)
dom/html/HTMLMediaElement.cpp
dom/html/HTMLMediaElement.h
dom/media/MediaResult.h
dom/media/test/test_decode_error.html
dom/media/test/test_error_in_video_document.html
dom/media/test/test_invalid_reject.html
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1035,21 +1035,22 @@ void HTMLMediaElement::AbortExistingLoad
   if (mTextTrackManager) {
     mTextTrackManager->NotifyReset();
   }
 
   mEventDeliveryPaused = false;
   mPendingEvents.Clear();
 }
 
-void HTMLMediaElement::NoSupportedMediaSourceError(const nsACString& aErrorDetails)
+void HTMLMediaElement::NoSupportedMediaSourceError()
 {
   NS_ASSERTION(mNetworkState == NETWORK_LOADING,
                "Not loading during source selection?");
-  mError = new MediaError(this, MEDIA_ERR_SRC_NOT_SUPPORTED, aErrorDetails);
+
+  mError = new MediaError(this, MEDIA_ERR_SRC_NOT_SUPPORTED);
   ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_NO_SOURCE);
   DispatchAsyncEvent(NS_LITERAL_STRING("error"));
   ChangeDelayLoadStatus(false);
   UpdateAudioChannelPlayingState();
   OpenUnsupportedMediaWithExtenalAppIfNeeded();
 }
 
 typedef void (HTMLMediaElement::*SyncSectionFn)();
@@ -4410,21 +4411,17 @@ void HTMLMediaElement::FirstFrameLoaded(
   }
 }
 
 void HTMLMediaElement::NetworkError()
 {
   if (mDecoder) {
     ShutdownDecoder();
   }
-  if (mReadyState == nsIDOMHTMLMediaElement::HAVE_NOTHING) {
-    NoSupportedMediaSourceError();
-  } else {
-    Error(MEDIA_ERR_NETWORK);
-  }
+  Error(MEDIA_ERR_NETWORK);
 }
 
 void HTMLMediaElement::DecodeError(const MediaResult& aError)
 {
   nsAutoString src;
   GetCurrentSrc(src);
   const char16_t* params[] = { src.get() };
   ReportLoadError("MediaLoadDecodeError", params, ArrayLength(params));
@@ -4440,53 +4437,58 @@ void HTMLMediaElement::DecodeError(const
   if (mIsLoadingFromSourceChildren) {
     mError = nullptr;
     if (mSourceLoadCandidate) {
       DispatchAsyncSourceError(mSourceLoadCandidate);
       QueueLoadFromSourceTask();
     } else {
       NS_WARNING("Should know the source we were loading from!");
     }
-  } else if (mReadyState == nsIDOMHTMLMediaElement::HAVE_NOTHING) {
-    NoSupportedMediaSourceError(aError.Description());
   } else {
-    Error(MEDIA_ERR_DECODE, aError.Description());
+    Error(MEDIA_ERR_DECODE, aError);
   }
 }
 
 bool HTMLMediaElement::HasError() const
 {
   return GetError();
 }
 
 void HTMLMediaElement::LoadAborted()
 {
   Error(MEDIA_ERR_ABORTED);
 }
 
 void HTMLMediaElement::Error(uint16_t aErrorCode,
-                             const nsACString& aErrorDetails)
+                             const MediaResult& aErrorDetails)
 {
   NS_ASSERTION(aErrorCode == MEDIA_ERR_DECODE ||
                aErrorCode == MEDIA_ERR_NETWORK ||
                aErrorCode == MEDIA_ERR_ABORTED,
                "Only use MediaError codes!");
-  NS_ASSERTION(mReadyState > HAVE_NOTHING,
-               "Shouldn't be called when readyState is HAVE_NOTHING");
 
   // Since we have multiple paths calling into DecodeError, e.g.
   // MediaKeys::Terminated and EMEH264Decoder::Error. We should take the 1st
   // one only in order not to fire multiple 'error' events.
   if (mError) {
     return;
   }
-  mError = new MediaError(this, aErrorCode, aErrorDetails);
+  nsCString message;
+  if (NS_FAILED(aErrorDetails)) {
+    message = aErrorDetails.Description();
+  }
+  mError = new MediaError(this, aErrorCode, message);
 
   DispatchAsyncEvent(NS_LITERAL_STRING("error"));
-  ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_IDLE);
+  if (mReadyState == nsIDOMHTMLMediaElement::HAVE_NOTHING) {
+    ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_EMPTY);
+    DispatchAsyncEvent(NS_LITERAL_STRING("emptied"));
+  } else {
+    ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_IDLE);
+  }
   ChangeDelayLoadStatus(false);
   UpdateAudioChannelPlayingState();
 }
 
 void HTMLMediaElement::PlaybackEnded()
 {
   // We changed state which can affect AddRemoveSelfReference
   AddRemoveSelfReference();
--- a/dom/html/HTMLMediaElement.h
+++ b/dom/html/HTMLMediaElement.h
@@ -956,17 +956,17 @@ protected:
    */
   void AbortExistingLoads();
 
   /**
    * Called when all potential resources are exhausted. Changes network
    * state to NETWORK_NO_SOURCE, and sends error event with code
    * MEDIA_ERR_SRC_NOT_SUPPORTED.
    */
-  void NoSupportedMediaSourceError(const nsACString& aErrorDetails = nsCString());
+  void NoSupportedMediaSourceError();
 
   /**
    * Attempts to load resources from the <source> children. This is a
    * substep of the resource selection algorithm. Do not call this directly,
    * call QueueLoadFromSourceTask() instead.
    */
   void LoadFromSourceChildren();
 
@@ -1122,17 +1122,17 @@ protected:
    * Dispatches an error event to a child source element.
    */
   void DispatchAsyncSourceError(nsIContent* aSourceElement);
 
   /**
    * Resets the media element for an error condition as per aErrorCode.
    * aErrorCode must be one of nsIDOMHTMLMediaError codes.
    */
-  void Error(uint16_t aErrorCode, const nsACString& aErrorDetails = nsCString());
+  void Error(uint16_t aErrorCode, const MediaResult& aErrorDetails = NS_OK);
 
   /**
    * Returns the URL spec of the currentSrc.
    **/
   void GetCurrentSpec(nsCString& aString);
 
   /**
    * Process any media fragment entries in the URI
--- a/dom/media/MediaResult.h
+++ b/dom/media/MediaResult.h
@@ -43,19 +43,16 @@ public:
 
   // Interoperations with nsresult.
   bool operator==(nsresult aResult) const { return aResult == mCode; }
   bool operator!=(nsresult aResult) const { return aResult != mCode; }
   operator nsresult () const { return mCode; }
 
   nsCString Description() const
   {
-    if (NS_SUCCEEDED(mCode)) {
-      return nsCString();
-    }
     return nsPrintfCString("0x%08x: %s", mCode, mMessage.get());
   }
 
 private:
   nsresult mCode;
   nsCString mMessage;
 };
 
--- a/dom/media/test/test_decode_error.html
+++ b/dom/media/test/test_decode_error.html
@@ -21,21 +21,17 @@ function startTest(test, token) {
 
   var v = document.createElement("video");
   manager.started(token);
   v.addEventListener("error", function (event) {
     var el = event.currentTarget;
     is(event.type, "error", "Expected event of type 'error'");
     ok(el.error, "Element 'error' attr expected to have a value");
     ok(el.error instanceof MediaError, "Element 'error' attr expected to be MediaError");
-    if (v.readyState == v.HAVE_NOTHING) {
-      is(el.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED, "Expected media not supported error");
-    } else {
-      is(el.error.code, MediaError.MEDIA_ERR_DECODE, "Expected a decode error");
-    }
+    is(el.error.code, MediaError.MEDIA_ERR_DECODE, "Expected a decode error");
     ok(typeof el.error.message === 'string' || el.error.essage instanceof String, "Element 'message' attr expected to be a string");
     ok(el.error.message.length > 0, "Element 'message' attr has content");
     el._sawError = true;
     manager.finished(token);
   }, false);
 
   v.addEventListener("loadeddata", function () {
     ok(false, "Unexpected loadeddata event");
--- a/dom/media/test/test_error_in_video_document.html
+++ b/dom/media/test/test_error_in_video_document.html
@@ -26,21 +26,23 @@ function documentVideo() {
                  .contentDocument.body.getElementsByTagName("video")[0];
 }
 
 function check() {
   var v = documentVideo();
 
   // Debug info for Bug 608634
   ok(true, "iframe src=" + document.body.getElementsByTagName("iframe")[0].src);
-  is(v.readyState, v.HAVE_NOTHING, "Ready state");
+  is(v.readyState, 0, "Ready state");
 
+  is(v.networkState, 0, "Network state");
   isnot(v.error, null, "Error object");
-  is(v.networkState, v.NETWORK_NO_SOURCE, "Network state");
-  is(v.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED, "Expected media not supported error");
+  if (v.error)
+    is(v.error.code, MediaError.MEDIA_ERR_DECODE, "Error code");
+
   SimpleTest.finish();
 }
 
 // Find an error test that we'd think we should be able to play (if it
 // wasn't already known to fail).
 var t = getPlayableVideo(gErrorTests);
 if (!t) {
   todo(false, "No types supported");
--- a/dom/media/test/test_invalid_reject.html
+++ b/dom/media/test/test_invalid_reject.html
@@ -27,23 +27,18 @@ function startTest(test, token) {
       'playing'
   ];
   events.forEach( function(e) {
     v.addEventListener(e, badEvent(e));
   });
 
   // Seeing a decoder error is a success.
   v.addEventListener("error", function onerror(e) {
-    if (v.readyState == v.HAVE_NOTHING) {
-      is(v.error.code, v.error.MEDIA_ERR_SRC_NOT_SUPPORTED,
-         "decoder should reject " + test.name);
-    } else {
-      is(v.error.code, v.error.MEDIA_ERR_DECODE,
-         "decoder should reject " + test.name);
-    }
+    is(v.error.code, v.error.MEDIA_ERR_DECODE,
+      "decoder should reject " + test.name);
     v.removeEventListener('error', onerror, false);
     manager.finished(token);
   });
 
   // Now try to load and play the file, which should result in the
   // error event handler above being called, terminating the test.
   document.body.appendChild(v);
   v.src = test.name;