Backed out 2 changesets (bug 830672, bug 829561) for test failures. a=backout
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 24 Jan 2013 14:56:19 -0500
changeset 118316 d139dca8c3b483a73424c23dd956bf12d02d687e
parent 118315 1f8f9ca4d02a862b146f47b63d81209ddebc105a
child 118317 9880592551e93c1bdc8b09c8750c06f0231c4d90
push id346
push userryanvm@gmail.com
push dateThu, 24 Jan 2013 19:56:25 +0000
reviewersbackout
bugs830672, 829561
milestone18.0
Backed out 2 changesets (bug 830672, bug 829561) for test failures. a=backout
dom/audiochannel/AudioChannelService.cpp
dom/audiochannel/AudioChannelService.h
dom/audiochannel/Makefile.in
dom/audiochannel/tests/Makefile.in
dom/audiochannel/tests/TestAudioChannelService.cpp
dom/ipc/ContentParent.h
--- a/dom/audiochannel/AudioChannelService.cpp
+++ b/dom/audiochannel/AudioChannelService.cpp
@@ -86,17 +86,17 @@ AudioChannelService::~AudioChannelServic
 void
 AudioChannelService::RegisterAudioChannelAgent(AudioChannelAgent* aAgent,
                                                AudioChannelType aType)
 {
   AudioChannelAgentData* data = new AudioChannelAgentData(aType,
                                                           true /* mElementHidden */,
                                                           true /* mMuted */);
   mAgents.Put(aAgent, data);
-  RegisterType(aType, CONTENT_PARENT_NO_CHILD_ID);
+  RegisterType(aType, CONTENT_PARENT_UNKNOWN_CHILD_ID);
 }
 
 void
 AudioChannelService::RegisterType(AudioChannelType aType, uint64_t aChildID)
 {
   AudioChannelInternalType type = GetInternalType(aType, true);
   mChannelCounters[type].AppendElement(aChildID);
 
@@ -110,17 +110,17 @@ AudioChannelService::RegisterType(AudioC
 
 void
 AudioChannelService::UnregisterAudioChannelAgent(AudioChannelAgent* aAgent)
 {
   nsAutoPtr<AudioChannelAgentData> data;
   mAgents.RemoveAndForget(aAgent, data);
 
   if (data) {
-    UnregisterType(data->mType, data->mElementHidden, CONTENT_PARENT_NO_CHILD_ID);
+    UnregisterType(data->mType, data->mElementHidden, CONTENT_PARENT_UNKNOWN_CHILD_ID);
   }
 }
 
 void
 AudioChannelService::UnregisterType(AudioChannelType aType,
                                     bool aElementHidden,
                                     uint64_t aChildID)
 {
@@ -140,17 +140,17 @@ AudioChannelService::UnregisterType(Audi
 bool
 AudioChannelService::GetMuted(AudioChannelAgent* aAgent, bool aElementHidden)
 {
   AudioChannelAgentData* data;
   if (!mAgents.Get(aAgent, &data)) {
     return true;
   }
 
-  bool muted = GetMutedInternal(data->mType, CONTENT_PARENT_NO_CHILD_ID,
+  bool muted = GetMutedInternal(data->mType, CONTENT_PARENT_UNKNOWN_CHILD_ID,
                                 aElementHidden, data->mElementHidden);
 
   // Update visibility.
   data->mElementHidden = aElementHidden;
   data->mMuted = muted;
 
   SendAudioChannelChangedNotification();
   return muted;
@@ -223,17 +223,17 @@ AudioChannelService::SendAudioChannelCha
 {
   if (XRE_GetProcessType() != GeckoProcessType_Default) {
     return;
   }
 
   // Calculating the most important active channel.
   AudioChannelType higher = AUDIO_CHANNEL_LAST;
 
-  // Top-Down in the hierarchy for visible elements
+  // Top-Down in the hierarchy.
   if (!mChannelCounters[AUDIO_CHANNEL_INT_PUBLICNOTIFICATION].IsEmpty()) {
     higher = AUDIO_CHANNEL_PUBLICNOTIFICATION;
   }
 
   else if (!mChannelCounters[AUDIO_CHANNEL_INT_RINGER].IsEmpty()) {
     higher = AUDIO_CHANNEL_RINGER;
   }
 
@@ -244,51 +244,28 @@ AudioChannelService::SendAudioChannelCha
   else if (!mChannelCounters[AUDIO_CHANNEL_INT_ALARM].IsEmpty()) {
     higher = AUDIO_CHANNEL_ALARM;
   }
 
   else if (!mChannelCounters[AUDIO_CHANNEL_INT_NOTIFICATION].IsEmpty()) {
     higher = AUDIO_CHANNEL_NOTIFICATION;
   }
 
-  else if (!mChannelCounters[AUDIO_CHANNEL_INT_CONTENT].IsEmpty()) {
+  // Only 1 content channel hidden or a visible one.
+  else if ((!mChannelCounters[AUDIO_CHANNEL_INT_CONTENT_HIDDEN].IsEmpty() &&
+            !HasMoreThanOneContentChannelHidden()) ||
+           !mChannelCounters[AUDIO_CHANNEL_INT_CONTENT].IsEmpty()) {
     higher = AUDIO_CHANNEL_CONTENT;
   }
 
+  // At least 1 visible normal channel.
   else if (!mChannelCounters[AUDIO_CHANNEL_INT_NORMAL].IsEmpty()) {
     higher = AUDIO_CHANNEL_NORMAL;
   }
 
-  // Top-Down in the hierarchy for non-visible elements
-  else if (!mChannelCounters[AUDIO_CHANNEL_INT_PUBLICNOTIFICATION_HIDDEN].IsEmpty()) {
-    higher = AUDIO_CHANNEL_PUBLICNOTIFICATION;
-  }
-
-  else if (!mChannelCounters[AUDIO_CHANNEL_INT_RINGER_HIDDEN].IsEmpty()) {
-    higher = AUDIO_CHANNEL_RINGER;
-  }
-
-  else if (!mChannelCounters[AUDIO_CHANNEL_INT_TELEPHONY_HIDDEN].IsEmpty()) {
-    higher = AUDIO_CHANNEL_TELEPHONY;
-  }
-
-  else if (!mChannelCounters[AUDIO_CHANNEL_INT_ALARM_HIDDEN].IsEmpty()) {
-    higher = AUDIO_CHANNEL_ALARM;
-  }
-
-  else if (!mChannelCounters[AUDIO_CHANNEL_INT_NOTIFICATION_HIDDEN].IsEmpty()) {
-    higher = AUDIO_CHANNEL_NOTIFICATION;
-  }
-
-  // Content channels play in background if just one is active.
-  else if ((!mChannelCounters[AUDIO_CHANNEL_INT_CONTENT_HIDDEN].IsEmpty() &&
-            !HasMoreThanOneContentChannelHidden())) {
-    higher = AUDIO_CHANNEL_CONTENT;
-  }
-
   if (higher != mCurrentHigherChannel) {
     mCurrentHigherChannel = higher;
 
     nsString channelName;
     if (mCurrentHigherChannel != AUDIO_CHANNEL_LAST) {
       channelName.AssignASCII(ChannelName(mCurrentHigherChannel));
     } else {
       channelName.AssignLiteral("none");
@@ -322,17 +299,17 @@ AudioChannelService::Notify()
   for (uint32_t i = 0; i < children.Length(); i++) {
     unused << children[i]->SendAudioChannelNotify();
   }
 }
 
 bool
 AudioChannelService::ChannelsActiveWithHigherPriorityThan(AudioChannelInternalType aType)
 {
-  for (int i = AUDIO_CHANNEL_INT_LAST - 1;
+  for (int i = AUDIO_CHANNEL_INT_PUBLICNOTIFICATION;
        i != AUDIO_CHANNEL_INT_CONTENT_HIDDEN; --i) {
     if (i == aType) {
       return false;
     }
 
     if (!mChannelCounters[i].IsEmpty()) {
       return true;
     }
@@ -407,48 +384,36 @@ AudioChannelService::Observe(nsISupports
 
 AudioChannelService::AudioChannelInternalType
 AudioChannelService::GetInternalType(AudioChannelType aType,
                                      bool aElementHidden)
 {
   switch (aType) {
     case AUDIO_CHANNEL_NORMAL:
       return aElementHidden
-               ? AUDIO_CHANNEL_INT_NORMAL_HIDDEN
-               : AUDIO_CHANNEL_INT_NORMAL;
+               ? AUDIO_CHANNEL_INT_NORMAL_HIDDEN : AUDIO_CHANNEL_INT_NORMAL;
 
     case AUDIO_CHANNEL_CONTENT:
       return aElementHidden
-               ? AUDIO_CHANNEL_INT_CONTENT_HIDDEN
-               : AUDIO_CHANNEL_INT_CONTENT;
+               ? AUDIO_CHANNEL_INT_CONTENT_HIDDEN : AUDIO_CHANNEL_INT_CONTENT;
 
     case AUDIO_CHANNEL_NOTIFICATION:
-      return aElementHidden
-               ? AUDIO_CHANNEL_INT_NOTIFICATION_HIDDEN
-               : AUDIO_CHANNEL_INT_NOTIFICATION;
+      return AUDIO_CHANNEL_INT_NOTIFICATION;
 
     case AUDIO_CHANNEL_ALARM:
-      return aElementHidden
-               ? AUDIO_CHANNEL_INT_ALARM_HIDDEN
-               : AUDIO_CHANNEL_INT_ALARM;
+      return AUDIO_CHANNEL_INT_ALARM;
 
     case AUDIO_CHANNEL_TELEPHONY:
-      return aElementHidden
-               ? AUDIO_CHANNEL_INT_TELEPHONY_HIDDEN
-               : AUDIO_CHANNEL_INT_TELEPHONY;
+      return AUDIO_CHANNEL_INT_TELEPHONY;
 
     case AUDIO_CHANNEL_RINGER:
-      return aElementHidden
-               ? AUDIO_CHANNEL_INT_RINGER_HIDDEN
-               : AUDIO_CHANNEL_INT_RINGER;
+      return AUDIO_CHANNEL_INT_RINGER;
 
     case AUDIO_CHANNEL_PUBLICNOTIFICATION:
-      return aElementHidden
-               ? AUDIO_CHANNEL_INT_PUBLICNOTIFICATION_HIDDEN
-               : AUDIO_CHANNEL_INT_PUBLICNOTIFICATION;
+      return AUDIO_CHANNEL_INT_PUBLICNOTIFICATION;
 
     case AUDIO_CHANNEL_LAST:
     default:
       break;
   }
 
   MOZ_NOT_REACHED();
   return AUDIO_CHANNEL_INT_LAST;
--- a/dom/audiochannel/AudioChannelService.h
+++ b/dom/audiochannel/AudioChannelService.h
@@ -79,25 +79,20 @@ protected:
   virtual ~AudioChannelService();
 
   enum AudioChannelInternalType {
     AUDIO_CHANNEL_INT_NORMAL = 0,
     AUDIO_CHANNEL_INT_NORMAL_HIDDEN,
     AUDIO_CHANNEL_INT_CONTENT,
     AUDIO_CHANNEL_INT_CONTENT_HIDDEN,
     AUDIO_CHANNEL_INT_NOTIFICATION,
-    AUDIO_CHANNEL_INT_NOTIFICATION_HIDDEN,
     AUDIO_CHANNEL_INT_ALARM,
-    AUDIO_CHANNEL_INT_ALARM_HIDDEN,
     AUDIO_CHANNEL_INT_TELEPHONY,
-    AUDIO_CHANNEL_INT_TELEPHONY_HIDDEN,
     AUDIO_CHANNEL_INT_RINGER,
-    AUDIO_CHANNEL_INT_RINGER_HIDDEN,
     AUDIO_CHANNEL_INT_PUBLICNOTIFICATION,
-    AUDIO_CHANNEL_INT_PUBLICNOTIFICATION_HIDDEN,
     AUDIO_CHANNEL_INT_LAST
   };
 
   bool ChannelsActiveWithHigherPriorityThan(AudioChannelInternalType aType);
 
   bool HasMoreThanOneContentChannelHidden();
 
   const char* ChannelName(AudioChannelType aType);
--- a/dom/audiochannel/Makefile.in
+++ b/dom/audiochannel/Makefile.in
@@ -41,17 +41,12 @@ CPPSRCS += \
   AudioChannelServiceChild.cpp \
   AudioChannelAgent.cpp \
   $(NULL)
 
 XPIDLSRCS = \
   nsIAudioChannelAgent.idl \
   $(NULL)
 
-
-ifdef ENABLE_TESTS
-TOOL_DIRS += tests
-endif
-
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
deleted file mode 100644
--- a/dom/audiochannel/tests/Makefile.in
+++ /dev/null
@@ -1,22 +0,0 @@
-# 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/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-relativesrcdir = @relativesrcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE           = dom
-FAIL_ON_WARNINGS = 1
-
-CPP_UNIT_TESTS = \
-		TestAudioChannelService.cpp \
-		$(NULL)
-
-include $(topsrcdir)/config/config.mk
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/dom/audiochannel/tests/TestAudioChannelService.cpp
+++ /dev/null
@@ -1,370 +0,0 @@
-/* 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/. */
-
-#include "TestHarness.h"
-
-#include "AudioChannelService.h"
-#include "AudioChannelAgent.h"
-
-#define TEST_ENSURE_BASE(_test, _msg)       \
-  PR_BEGIN_MACRO                            \
-    if (!_test) {                           \
-      fail(_msg);                           \
-      return NS_ERROR_FAILURE;              \
-    } else {                                \
-      passed(_msg);                         \
-    }                                       \
-  PR_END_MACRO
-
-using namespace mozilla::dom;
-
-class Agent
-{
-public:
-  Agent(AudioChannelType aType)
-  : mType(aType)
-  , mRegistered(false)
-  {
-    mAgent = do_CreateInstance("@mozilla.org/audiochannelagent;1");
-  }
-
-  nsresult Init()
-  {
-    nsresult rv = mAgent->Init(mType, nullptr);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    return mAgent->SetVisibilityState(false);
-  }
-
-  nsresult StartPlaying(bool *_ret)
-  {
-    if (mRegistered)
-      StopPlaying();
-
-    nsresult rv = mAgent->StartPlaying(_ret);
-    mRegistered = true;
-    return rv;
-  }
-
-  nsresult StopPlaying()
-  {
-    mRegistered = false;
-    return mAgent->StopPlaying();
-  }
-
-  nsCOMPtr<AudioChannelAgent> mAgent;
-  AudioChannelType mType;
-  bool mRegistered;
-};
-
-nsresult
-TestDoubleStartPlaying()
-{
-  Agent agent(AUDIO_CHANNEL_NORMAL);
-  nsresult rv = agent.Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  bool playing;
-  rv = agent.mAgent->StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = agent.mAgent->StartPlaying(&playing);
-  TEST_ENSURE_BASE(NS_FAILED(rv), "Test0: StartPlaying calling twice should return error");
-
-  return NS_OK;
-}
-
-nsresult
-TestOneNormalChannel()
-{
-  Agent agent(AUDIO_CHANNEL_NORMAL);
-  nsresult rv = agent.Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  bool playing;
-  rv = agent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(!playing, "Test1: A normal channel unvisible agent must not be playing");
-
-  rv = agent.mAgent->SetVisibilityState(true);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = agent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test1: A normal channel visible agent should be playing");
-
-  return rv;
-}
-
-nsresult
-TestTwoNormalChannels()
-{
-  Agent agent1(AUDIO_CHANNEL_NORMAL);
-  nsresult rv = agent1.Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  Agent agent2(AUDIO_CHANNEL_NORMAL);
-  rv = agent2.Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  bool playing;
-  rv = agent1.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(!playing, "Test2: A normal channel unvisible agent1 must not be playing");
-
-  rv = agent2.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(!playing, "Test2: A normal channel unvisible agent2 must not be playing");
-
-  rv = agent1.mAgent->SetVisibilityState(true);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = agent2.mAgent->SetVisibilityState(true);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = agent1.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test2: A normal channel visible agent1 should be playing");
-
-  rv = agent2.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test2: A normal channel visible agent2 should be playing");
-
-  return rv;
-}
-
-nsresult
-TestContentChannels()
-{
-  Agent agent1(AUDIO_CHANNEL_CONTENT);
-  nsresult rv = agent1.Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  Agent agent2(AUDIO_CHANNEL_CONTENT);
-  rv = agent2.Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  bool playing;
-  rv = agent1.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test3: A content channel unvisible agent1 should be playing");
-
-  rv = agent2.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test3: A content channel unvisible agent2 should be playing");
-
-  rv = agent1.mAgent->SetVisibilityState(true);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = agent2.mAgent->SetVisibilityState(false);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = agent1.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test3: A content channel visible agent1 should be playing");
-
-  rv = agent2.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(!playing, "Test3: A content channel unvisible agent2 should not be playing");
-
-  rv = agent1.mAgent->SetVisibilityState(true);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = agent2.mAgent->SetVisibilityState(true);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = agent1.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test3: A content channel visible agent1 should be playing");
-
-  rv = agent2.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test3: A content channel visible agent2 should be playing");
-
-  return rv;
-}
-
-nsresult
-TestPriorities()
-{
-  Agent normalAgent(AUDIO_CHANNEL_NORMAL);
-  nsresult rv = normalAgent.Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  Agent contentAgent(AUDIO_CHANNEL_CONTENT);
-  rv = contentAgent.Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  Agent notificationAgent(AUDIO_CHANNEL_NOTIFICATION);
-  rv = notificationAgent.Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  Agent alarmAgent(AUDIO_CHANNEL_ALARM);
-  rv = alarmAgent.Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  Agent telephonyAgent(AUDIO_CHANNEL_TELEPHONY);
-  rv = telephonyAgent.Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  Agent ringerAgent(AUDIO_CHANNEL_RINGER);
-  rv = ringerAgent.Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  Agent pNotificationAgent(AUDIO_CHANNEL_PUBLICNOTIFICATION);
-  rv = pNotificationAgent.Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  bool playing;
-
-  // Normal should not be playing because not visible.
-  rv = normalAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(!playing, "Test4: A normal channel unvisible agent should not be playing");
-
-  // Content should be playing.
-  rv = contentAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test4: A content channel unvisible agent should be playing");
-
-  // Notification should be playing.
-  rv = notificationAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test4: An notification channel unvisible agent should be playing");
-
-  // Now content should be not playing because of the notification playing.
-  rv = contentAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(!playing, "Test4: A content channel unvisible agent should not be playing when notification channel is playing");
-
-  // Adding an alarm.
-  rv = alarmAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test4: An alarm channel unvisible agent should be playing");
-
-  // Now notification should be not playing because of the alarm playing.
-  rv = notificationAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(!playing, "Test4: A notification channel unvisible agent should not be playing when an alarm is playing");
-
-  // Adding an telephony.
-  rv = telephonyAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test4: An telephony channel unvisible agent should be playing");
-
-  // Now alarm should be not playing because of the telephony playing.
-  rv = alarmAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(!playing, "Test4: A alarm channel unvisible agent should not be playing when a telephony is playing");
-
-  // Adding an ringer.
-  rv = ringerAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test4: An ringer channel unvisible agent should be playing");
-
-  // Now telephony should be not playing because of the ringer playing.
-  rv = telephonyAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(!playing, "Test4: A telephony channel unvisible agent should not be playing when a riger is playing");
-
-  // Adding an pNotification.
-  rv = pNotificationAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test4: An pNotification channel unvisible agent should be playing");
-
-  // Now ringer should be not playing because of the public notification playing.
-  rv = ringerAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(!playing, "Test4: A ringer channel unvisible agent should not be playing when a public notification is playing");
-
-  // Settings visible the normal channel.
-  rv = normalAgent.mAgent->SetVisibilityState(true);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Normal should be playing because visible.
-  rv = normalAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test4: A normal channel visible agent should be playing");
-
-  // Settings visible the content channel.
-  rv = contentAgent.mAgent->SetVisibilityState(true);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Content should be playing because visible.
-  rv = contentAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test4: A content channel visible agent should be playing");
-
-  // Settings visible the notification channel.
-  rv = notificationAgent.mAgent->SetVisibilityState(true);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Notification should be playing because visible.
-  rv = notificationAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test4: A notification channel visible agent should be playing");
-
-  // Settings visible the alarm channel.
-  rv = alarmAgent.mAgent->SetVisibilityState(true);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Alarm should be playing because visible.
-  rv = alarmAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test4: A alarm channel visible agent should be playing");
-
-  // Settings visible the telephony channel.
-  rv = telephonyAgent.mAgent->SetVisibilityState(true);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Telephony should be playing because visible.
-  rv = telephonyAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test4: A telephony channel visible agent should be playing");
-
-  // Settings visible the ringer channel.
-  rv = ringerAgent.mAgent->SetVisibilityState(true);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Ringer should be playing because visible.
-  rv = ringerAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test4: A ringer channel visible agent should be playing");
-
-  // Settings visible the pNotification channel.
-  rv = pNotificationAgent.mAgent->SetVisibilityState(true);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // pNotification should be playing because visible.
-  rv = pNotificationAgent.StartPlaying(&playing);
-  NS_ENSURE_SUCCESS(rv, rv);
-  TEST_ENSURE_BASE(playing, "Test4: A pNotification channel visible agent should be playing");
-
-  return rv;
-}
-
-int main(int argc, char** argv)
-{
-  ScopedXPCOM xpcom("AudioChannelService");
-  if (xpcom.failed())
-    return 1;
-
-  if (NS_FAILED(TestDoubleStartPlaying()))
-    return 1;
-
-  if (NS_FAILED(TestOneNormalChannel()))
-    return 1;
-
-  if (NS_FAILED(TestTwoNormalChannels()))
-    return 1;
-
-  if (NS_FAILED(TestContentChannels()))
-    return 1;
-
-  if (NS_FAILED(TestPriorities()))
-    return 1;
-
-  return 0;
-}
-
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -25,17 +25,16 @@
 #include "nsIMemoryReporter.h"
 #include "nsCOMArray.h"
 #include "nsDataHashtable.h"
 #include "nsHashKeys.h"
 #include "PermissionMessageUtils.h"
 
 #define CHILD_PROCESS_SHUTDOWN_MESSAGE NS_LITERAL_STRING("child-process-shutdown")
 
-#define CONTENT_PARENT_NO_CHILD_ID 0
 #define CONTENT_PARENT_UNKNOWN_CHILD_ID -1
 
 class mozIApplication;
 class nsConsoleService;
 class nsIDOMBlob;
 class nsDOMFileBase;
 
 namespace mozilla {