Backed out changeset 5506e7033c85 (bug 925594) perma-orange mochitest test-failure on b2g-ics
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 28 Oct 2013 15:34:08 +0100
changeset 167253 d4a27d8eda2864f11e7f9fb50b347d5f71ea015f
parent 167252 2a74ccca63438869c3459a9c9ddf74402849b510
child 167254 e7439c6c1e81004d46a388fe5856cc1240317f87
child 178483 5822931bbb59d383e3175df3db1f0f758a787a15
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs925594
milestone27.0a1
backs out5506e7033c85704f1f4c8c9a612b3107bb87e533
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 changeset 5506e7033c85 (bug 925594) perma-orange mochitest test-failure on b2g-ics
content/html/content/public/HTMLMediaElement.h
content/html/content/src/HTMLMediaElement.cpp
content/html/content/test/test_mozaudiochannel.html
content/media/webaudio/AudioContext.h
content/media/webaudio/AudioDestinationNode.h
dom/webidl/AudioChannel.webidl
dom/webidl/AudioContext.webidl
dom/webidl/HTMLMediaElement.webidl
dom/webidl/moz.build
--- a/content/html/content/public/HTMLMediaElement.h
+++ b/content/html/content/public/HTMLMediaElement.h
@@ -12,17 +12,16 @@
 #include "nsCycleCollectionParticipant.h"
 #include "nsIObserver.h"
 #include "mozilla/CORSMode.h"
 #include "DOMMediaStream.h"
 #include "AudioChannelCommon.h"
 #include "DecoderTraits.h"
 #include "nsIAudioChannelAgent.h"
 #include "mozilla/Attributes.h"
-#include "mozilla/dom/AudioChannelBinding.h"
 #include "mozilla/dom/TextTrackManager.h"
 
 // Define to output information on decoding and painting framerate
 /* #define DEBUG_FRAME_RATE 1 */
 
 class nsIChannel;
 class nsIHttpChannel;
 class nsILoadGroup;
@@ -509,18 +508,22 @@ public:
   uint32_t GetMozFrameBufferLength(ErrorResult& aRv) const;
 
   void SetMozFrameBufferLength(uint32_t aValue, ErrorResult& aRv);
 
   JSObject* MozGetMetadata(JSContext* aCx, ErrorResult& aRv);
 
   double MozFragmentEnd();
 
-  AudioChannel MozAudioChannelType() const;
-  void SetMozAudioChannelType(AudioChannel aValue, ErrorResult& aRv);
+  // XPCOM GetMozAudioChannelType() is OK
+
+  void SetMozAudioChannelType(const nsAString& aValue, ErrorResult& aRv)
+  {
+    SetHTMLAttr(nsGkAtoms::mozaudiochannel, aValue, aRv);
+  }
 
   TextTrackList* TextTracks() const;
 
   already_AddRefed<TextTrack> AddTextTrack(TextTrackKind aKind,
                                            const nsAString& aLabel,
                                            const nsAString& aLanguage);
 
   void AddTextTrack(TextTrack* aTextTrack) {
--- a/content/html/content/src/HTMLMediaElement.cpp
+++ b/content/html/content/src/HTMLMediaElement.cpp
@@ -3923,46 +3923,10 @@ HTMLMediaElement::AddTextTrack(TextTrack
 void
 HTMLMediaElement::PopulatePendingTextTrackList()
 {
   if (mTextTrackManager) {
     mTextTrackManager->PopulatePendingList();
   }
 }
 
-AudioChannel
-HTMLMediaElement::MozAudioChannelType() const
-{
-  switch (mAudioChannelType) {
-    case AUDIO_CHANNEL_CONTENT:
-      return AudioChannel::Content;
-
-    case AUDIO_CHANNEL_NOTIFICATION:
-      return AudioChannel::Notification;
-
-    case AUDIO_CHANNEL_ALARM:
-      return AudioChannel::Alarm;
-
-    case AUDIO_CHANNEL_TELEPHONY:
-      return AudioChannel::Telephony;
-
-    case AUDIO_CHANNEL_RINGER:
-      return AudioChannel::Ringer;
-
-    case AUDIO_CHANNEL_PUBLICNOTIFICATION:
-      return AudioChannel::Publicnotification;
-
-    default:
-      return AudioChannel::Normal;
-  }
-}
-
-void
-HTMLMediaElement::SetMozAudioChannelType(AudioChannel aValue, ErrorResult& aRv)
-{
-  nsString channel;
-  channel.AssignASCII(AudioChannelValues::strings[uint32_t(aValue)].value,
-                      AudioChannelValues::strings[uint32_t(aValue)].length);
-  SetHTMLAttr(nsGkAtoms::mozaudiochannel, channel, aRv);
-}
-
 } // namespace dom
 } // namespace mozilla
--- a/content/html/content/test/test_mozaudiochannel.html
+++ b/content/html/content/test/test_mozaudiochannel.html
@@ -38,16 +38,16 @@ audio2.mozAudioChannelType = "alarm";
 ok(audio2.mozAudioChannelType == "alarm", "Default audio2 channel == 'alarm'");
 
 var audio3 = document.getElementById("audio3");
 ok(audio3, "Audio Element exists");
 ok(audio3.mozAudioChannelType == "content", "Default audio3 channel == 'content'");
 try {
 audio3.mozAudioChannelType = "foo";
 } catch(e) {}
-ok(audio3.mozAudioChannelType == "content", "audio3 channel == 'content'");
+ok(audio3.mozAudioChannelType == "normal", "audio3 channel == 'normal'");
 audio3.mozAudioChannelType = "alarm";
 ok(audio3.mozAudioChannelType == "alarm", "audio3 channel == 'alarm'");
 
 </script>
 </pre>
 </body>
 </html>
--- a/content/media/webaudio/AudioContext.h
+++ b/content/media/webaudio/AudioContext.h
@@ -2,17 +2,17 @@
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #ifndef AudioContext_h_
 #define AudioContext_h_
 
-#include "mozilla/dom/AudioChannelBinding.h"
+#include "mozilla/dom/AudioContextBinding.h"
 #include "EnableWebAudioCheck.h"
 #include "MediaBufferDecoder.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/TypedArray.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDOMEventTargetHelper.h"
--- a/content/media/webaudio/AudioDestinationNode.h
+++ b/content/media/webaudio/AudioDestinationNode.h
@@ -2,17 +2,17 @@
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #ifndef AudioDestinationNode_h_
 #define AudioDestinationNode_h_
 
-#include "mozilla/dom/AudioChannelBinding.h"
+#include "mozilla/dom/AudioContextBinding.h"
 #include "AudioNode.h"
 #include "nsIDOMEventListener.h"
 #include "nsIAudioChannelAgent.h"
 #include "AudioChannelCommon.h"
 #include "nsWeakReference.h"
 
 namespace mozilla {
 namespace dom {
deleted file mode 100644
--- a/dom/webidl/AudioChannel.webidl
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/.
- */
-
-// AudioChannels are used by:
-// * HTMLMediaElement
-// * AudioContext (WebAudio)
-// When used, it has to throw an exception if the app tries to change the audio
-// channel type without the permission (manifest file for B2G apps).
-// The supported values are:
-// * normal (default value)
-//   Automatically paused if "notification" or higher priority channel
-//   is played
-//   Use case: normal applications
-// * content
-//   Automatically paused if "notification" or higher priority channel
-//   is played. Also paused if another app starts using "content"
-//   channel. Using this channel never affects applications using
-//   the "normal" channel.
-//   Use case: video/audio players
-// * notification
-//   Automatically paused if "alarm" or higher priority channel is played.
-//   Use case: New email, incoming SMS
-// * alarm
-//   Automatically paused if "telephony" or higher priority channel is
-//   played.
-//   User case: Alarm clock, calendar alarms
-// * telephony
-//   Automatically paused if "ringer" or higher priority
-//   channel is played.
-//   Use case: dialer, voip
-// * ringer
-//   Automatically paused if "publicnotification" or higher priority
-//   channel is played.
-//   Use case: dialer, voip
-// * publicnotification
-//   Always plays in speaker, even when headphones are plugged in.
-//   Use case: Camera shutter sound.
-enum AudioChannel {
-  "normal",
-  "content",
-  "notification",
-  "alarm",
-  "telephony",
-  "ringer",
-  "publicnotification",
-};
--- a/dom/webidl/AudioContext.webidl
+++ b/dom/webidl/AudioContext.webidl
@@ -93,14 +93,24 @@ partial interface AudioContext {
 
     // Same as createScriptProcessor()
     [NewObject, Throws, Pref="media.webaudio.legacy.AudioContext"]
     ScriptProcessorNode createJavaScriptNode(optional unsigned long bufferSize = 0,
                                              optional unsigned long numberOfInputChannels = 2,
                                              optional unsigned long numberOfOutputChannels = 2);
 };
 
+enum AudioChannel {
+  "normal",
+  "content",
+  "notification",
+  "alarm",
+  "telephony",
+  "ringer",
+  "publicnotification",
+};
+
 // Mozilla extensions
 partial interface AudioContext {
-  // Read AudioChannel.webidl for more information about this attribute.
+  // Read HTMLMediaElement.webidl for more information about this attribute.
   [Pref="media.useAudioChannelService", SetterThrows]
   attribute AudioChannel mozAudioChannelType;
 };
--- a/dom/webidl/HTMLMediaElement.webidl
+++ b/dom/webidl/HTMLMediaElement.webidl
@@ -128,17 +128,47 @@ partial interface HTMLMediaElement {
   object? mozGetMetadata();
 
   // Mozilla extension: provides access to the fragment end time if
   // the media element has a fragment URI for the currentSrc, otherwise
   // it is equal to the media duration.
   readonly attribute double mozFragmentEnd;
 
   // Mozilla extension: an audio channel type for media elements.
-  // Read AudioChannel.webidl for more information about this attribute.
+  // An exception is thrown if the app tries to change the audio channel type
+  // without the permission (manifest file for B2G apps).
+  // The supported values are:
+  // * normal (default value)
+  //   Automatically paused if "notification" or higher priority channel
+  //   is played
+  //   Use case: normal applications
+  // * content
+  //   Automatically paused if "notification" or higher priority channel
+  //   is played. Also paused if another app starts using "content"
+  //   channel. Using this channel never affects applications using
+  //   the "normal" channel.
+  //   Use case: video/audio players
+  // * notification
+  //   Automatically paused if "alarm" or higher priority channel is played.
+  //   Use case: New email, incoming SMS
+  // * alarm
+  //   Automatically paused if "telephony" or higher priority channel is
+  //   played.
+  //   User case: Alarm clock, calendar alarms
+  // * telephony
+  //   Automatically paused if "ringer" or higher priority
+  //   channel is played.
+  //   Use case: dialer, voip
+  // * ringer
+  //   Automatically paused if "publicnotification" or higher priority
+  //   channel is played.
+  //   Use case: dialer, voip
+  // * publicnotification
+  //   Always plays in speaker, even when headphones are plugged in.
+  //   Use case: Camera shutter sound.
   [SetterThrows]
-  attribute AudioChannel mozAudioChannelType;
+  attribute DOMString mozAudioChannelType;
 
   // In addition the media element has this new events:
   // * onmozinterruptbegin - called when the media element is interrupted
   //   because of the audiochannel manager.
   // * onmozinterruptend - called when the interruption is concluded
 };
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -21,17 +21,16 @@ WEBIDL_FILES = [
     'AnalyserNode.webidl',
     'AnimationEvent.webidl',
     'AppNotificationServiceOptions.webidl',
     'ArchiveReader.webidl',
     'ArchiveRequest.webidl',
     'Attr.webidl',
     'AudioBuffer.webidl',
     'AudioBufferSourceNode.webidl',
-    'AudioChannel.webidl',
     'AudioContext.webidl',
     'AudioDestinationNode.webidl',
     'AudioListener.webidl',
     'AudioNode.webidl',
     'AudioParam.webidl',
     'AudioProcessingEvent.webidl',
     'AudioStreamTrack.webidl',
     'BarProp.webidl',