diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index 499bf06184bd..42b6ca53e825 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -928,6 +928,15 @@ window.addEventListener('ContentStart', function update_onContentStart() { }, "headphones-status-changed", false); })(); +(function audioChannelChangedTracker() { + Services.obs.addObserver(function(aSubject, aTopic, aData) { + shell.sendChromeEvent({ + type: 'audio-channel-changed', + channel: aData + }); +}, "audio-channel-changed", false); +})(); + (function recordingStatusTracker() { let gRecordingActiveCount = 0; diff --git a/browser/components/tabview/test/Makefile.in b/browser/components/tabview/test/Makefile.in index 194533ce383b..758ada2fcfef 100644 --- a/browser/components/tabview/test/Makefile.in +++ b/browser/components/tabview/test/Makefile.in @@ -148,7 +148,6 @@ _BROWSER_FILES = \ browser_tabview_group.js \ browser_tabview_launch.js \ browser_tabview_multiwindow_search.js \ - browser_tabview_privatebrowsing.js \ browser_tabview_rtl.js \ browser_tabview_search.js \ browser_tabview_snapping.js \ @@ -175,6 +174,7 @@ _BROWSER_FILES += \ browser_tabview_bug624265.js \ browser_tabview_bug624727.js \ browser_tabview_bug650280.js \ + browser_tabview_privatebrowsing.js \ $(NULL) endif diff --git a/dom/audiochannel/AudioChannelCommon.h b/dom/audiochannel/AudioChannelCommon.h index b4992e169ab8..babd52e82388 100644 --- a/dom/audiochannel/AudioChannelCommon.h +++ b/dom/audiochannel/AudioChannelCommon.h @@ -18,7 +18,8 @@ enum AudioChannelType { AUDIO_CHANNEL_NOTIFICATION, AUDIO_CHANNEL_ALARM, AUDIO_CHANNEL_TELEPHONY, - AUDIO_CHANNEL_PUBLICNOTIFICATION + AUDIO_CHANNEL_PUBLICNOTIFICATION, + AUDIO_CHANNEL_LAST }; } // namespace dom diff --git a/dom/audiochannel/AudioChannelService.cpp b/dom/audiochannel/AudioChannelService.cpp index fad94a68d29c..d519bf051e81 100644 --- a/dom/audiochannel/AudioChannelService.cpp +++ b/dom/audiochannel/AudioChannelService.cpp @@ -5,6 +5,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "AudioChannelService.h" +#include "AudioChannelServiceChild.h" #include "base/basictypes.h" @@ -30,6 +31,10 @@ AudioChannelService::GetAudioChannelService() { MOZ_ASSERT(NS_IsMainThread()); + if (XRE_GetProcessType() != GeckoProcessType_Default) { + return AudioChannelServiceChild::GetAudioChannelService(); + } + // If we already exist, exit early if (gAudioChannelService) { return gAudioChannelService; @@ -46,6 +51,10 @@ AudioChannelService::GetAudioChannelService() void AudioChannelService::Shutdown() { + if (XRE_GetProcessType() != GeckoProcessType_Default) { + return AudioChannelServiceChild::Shutdown(); + } + if (gAudioChannelService) { delete gAudioChannelService; gAudioChannelService = nullptr; @@ -55,6 +64,7 @@ AudioChannelService::Shutdown() NS_IMPL_ISUPPORTS0(AudioChannelService) AudioChannelService::AudioChannelService() +: mCurrentHigherChannel(AUDIO_CHANNEL_NORMAL) { mChannelCounters = new int32_t[AUDIO_CHANNEL_PUBLICNOTIFICATION+1]; @@ -78,6 +88,12 @@ AudioChannelService::RegisterMediaElement(nsHTMLMediaElement* aMediaElement, AudioChannelType aType) { mMediaElements.Put(aMediaElement, aType); + RegisterType(aType); +} + +void +AudioChannelService::RegisterType(AudioChannelType aType) +{ mChannelCounters[aType]++; // In order to avoid race conditions, it's safer to notify any existing @@ -94,9 +110,14 @@ AudioChannelService::UnregisterMediaElement(nsHTMLMediaElement* aMediaElement) } mMediaElements.Remove(aMediaElement); + UnregisterType(type); +} - mChannelCounters[type]--; - MOZ_ASSERT(mChannelCounters[type] >= 0); +void +AudioChannelService::UnregisterType(AudioChannelType aType) +{ + mChannelCounters[aType]--; + MOZ_ASSERT(mChannelCounters[aType] >= 0); // In order to avoid race conditions, it's safer to notify any existing // media element any time a new one is registered. @@ -124,28 +145,62 @@ AudioChannelService::GetMuted(AudioChannelType aType, bool aElementHidden) case AUDIO_CHANNEL_PUBLICNOTIFICATION: // Nothing to do break; + + case AUDIO_CHANNEL_LAST: + MOZ_NOT_REACHED(); + return false; } } + bool muted = false; + // Priorities: switch (aType) { case AUDIO_CHANNEL_NORMAL: case AUDIO_CHANNEL_CONTENT: - return !!mChannelCounters[AUDIO_CHANNEL_NOTIFICATION] || - !!mChannelCounters[AUDIO_CHANNEL_ALARM] || - !!mChannelCounters[AUDIO_CHANNEL_TELEPHONY] || - !!mChannelCounters[AUDIO_CHANNEL_PUBLICNOTIFICATION]; + muted = !!mChannelCounters[AUDIO_CHANNEL_NOTIFICATION] || + !!mChannelCounters[AUDIO_CHANNEL_ALARM] || + !!mChannelCounters[AUDIO_CHANNEL_TELEPHONY] || + !!mChannelCounters[AUDIO_CHANNEL_PUBLICNOTIFICATION]; case AUDIO_CHANNEL_NOTIFICATION: case AUDIO_CHANNEL_ALARM: case AUDIO_CHANNEL_TELEPHONY: - return ChannelsActiveWithHigherPriorityThan(aType); + muted = ChannelsActiveWithHigherPriorityThan(aType); case AUDIO_CHANNEL_PUBLICNOTIFICATION: + break; + + case AUDIO_CHANNEL_LAST: + MOZ_NOT_REACHED(); return false; } - return false; + // Notification if needed. + if (!muted) { + + // Calculating the most important unmuted channel: + AudioChannelType higher = AUDIO_CHANNEL_NORMAL; + for (int32_t type = AUDIO_CHANNEL_NORMAL; + type <= AUDIO_CHANNEL_PUBLICNOTIFICATION; + ++type) { + if (mChannelCounters[type]) { + higher = (AudioChannelType)type; + } + } + + if (higher != mCurrentHigherChannel) { + mCurrentHigherChannel = higher; + + nsString channelName; + channelName.AssignASCII(ChannelName(mCurrentHigherChannel)); + + nsCOMPtr obs = mozilla::services::GetObserverService(); + obs->NotifyObservers(nullptr, "audio-channel-changed", channelName.get()); + } + } + + return muted; } @@ -166,6 +221,13 @@ AudioChannelService::Notify() // Notify any media element for the main process. mMediaElements.EnumerateRead(NotifyEnumerator, nullptr); + + // Notify for the child processes. + nsTArray children; + ContentParent::GetAll(children); + for (uint32_t i = 0; i < children.Length(); i++) { + unused << children[i]->SendAudioChannelNotify(); + } } bool @@ -184,3 +246,30 @@ AudioChannelService::ChannelsActiveWithHigherPriorityThan(AudioChannelType aType return false; } + +const char* +AudioChannelService::ChannelName(AudioChannelType aType) +{ + static struct { + int32_t type; + const char* value; + } ChannelNameTable[] = { + { AUDIO_CHANNEL_NORMAL, "normal" }, + { AUDIO_CHANNEL_CONTENT, "normal" }, + { AUDIO_CHANNEL_NOTIFICATION, "notification" }, + { AUDIO_CHANNEL_ALARM, "alarm" }, + { AUDIO_CHANNEL_TELEPHONY, "telephony" }, + { AUDIO_CHANNEL_PUBLICNOTIFICATION, "publicnotification" }, + { -1, "unknown" } + }; + + for (int i = AUDIO_CHANNEL_NORMAL; ; ++i) { + if (ChannelNameTable[i].type == aType || + ChannelNameTable[i].type == -1) { + return ChannelNameTable[i].value; + } + } + + NS_NOTREACHED("Execution should not reach here!"); + return nullptr; +} diff --git a/dom/audiochannel/AudioChannelService.h b/dom/audiochannel/AudioChannelService.h index 1958fc2a7fda..19a922582bad 100644 --- a/dom/audiochannel/AudioChannelService.h +++ b/dom/audiochannel/AudioChannelService.h @@ -37,31 +37,44 @@ public: * Any MediaElement that starts playing should register itself to * this service, sharing the AudioChannelType. */ - void RegisterMediaElement(nsHTMLMediaElement* aMediaElement, - AudioChannelType aType); + virtual void RegisterMediaElement(nsHTMLMediaElement* aMediaElement, + AudioChannelType aType); /** * Any MediaElement that stops playing should unregister itself to * this service. */ - void UnregisterMediaElement(nsHTMLMediaElement* aMediaElement); + virtual void UnregisterMediaElement(nsHTMLMediaElement* aMediaElement); /** * Return true if this type should be muted. */ virtual bool GetMuted(AudioChannelType aType, bool aElementHidden); +protected: void Notify(); -protected: + /* Register/Unregister IPC types: */ + void RegisterType(AudioChannelType aType); + void UnregisterType(AudioChannelType aType); + AudioChannelService(); virtual ~AudioChannelService(); bool ChannelsActiveWithHigherPriorityThan(AudioChannelType aType); + const char* ChannelName(AudioChannelType aType); + nsDataHashtable< nsPtrHashKey, AudioChannelType > mMediaElements; int32_t* mChannelCounters; + + AudioChannelType mCurrentHigherChannel; + + // This is needed for IPC comunication between + // AudioChannelServiceChild and this class. + friend class ContentParent; + friend class ContentChild; }; } // namespace dom diff --git a/dom/audiochannel/AudioChannelServiceChild.cpp b/dom/audiochannel/AudioChannelServiceChild.cpp new file mode 100644 index 000000000000..bff3b5ba9c8d --- /dev/null +++ b/dom/audiochannel/AudioChannelServiceChild.cpp @@ -0,0 +1,103 @@ +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* 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 "AudioChannelServiceChild.h" + +#include "base/basictypes.h" + +#include "mozilla/Services.h" +#include "mozilla/StaticPtr.h" +#include "mozilla/unused.h" +#include "mozilla/Util.h" + +#include "mozilla/dom/ContentChild.h" + +#include "base/basictypes.h" + +#include "nsThreadUtils.h" + +using namespace mozilla; +using namespace mozilla::dom; + +StaticRefPtr gAudioChannelServiceChild; + +// static +AudioChannelService* +AudioChannelServiceChild::GetAudioChannelService() +{ + MOZ_ASSERT(NS_IsMainThread()); + + // If we already exist, exit early + if (gAudioChannelServiceChild) { + return gAudioChannelServiceChild; + } + + // Create new instance, register, return + nsRefPtr service = new AudioChannelServiceChild(); + NS_ENSURE_TRUE(service, nullptr); + + gAudioChannelServiceChild = service; + return gAudioChannelServiceChild; +} + +void +AudioChannelServiceChild::Shutdown() +{ + if (gAudioChannelServiceChild) { + delete gAudioChannelServiceChild; + gAudioChannelServiceChild = nullptr; + } +} + +AudioChannelServiceChild::AudioChannelServiceChild() +{ +} + +AudioChannelServiceChild::~AudioChannelServiceChild() +{ +} + +bool +AudioChannelServiceChild::GetMuted(AudioChannelType aType, bool aMozHidden) +{ + ContentChild *cc = ContentChild::GetSingleton(); + bool muted = false; + + if (cc) { + cc->SendAudioChannelGetMuted(aType, aMozHidden, &muted); + } + + return muted; +} + +void +AudioChannelServiceChild::RegisterMediaElement(nsHTMLMediaElement* aMediaElement, + AudioChannelType aType) +{ + AudioChannelService::RegisterMediaElement(aMediaElement, aType); + + ContentChild *cc = ContentChild::GetSingleton(); + if (cc) { + cc->SendAudioChannelRegisterType(aType); + } +} + +void +AudioChannelServiceChild::UnregisterMediaElement(nsHTMLMediaElement* aMediaElement) +{ + AudioChannelType type; + if (!mMediaElements.Get(aMediaElement, &type)) { + return; + } + + AudioChannelService::UnregisterMediaElement(aMediaElement); + + ContentChild *cc = ContentChild::GetSingleton(); + if (cc) { + cc->SendAudioChannelUnregisterType(type); + } +} + diff --git a/dom/audiochannel/AudioChannelServiceChild.h b/dom/audiochannel/AudioChannelServiceChild.h new file mode 100644 index 000000000000..c5c7de166a9a --- /dev/null +++ b/dom/audiochannel/AudioChannelServiceChild.h @@ -0,0 +1,51 @@ +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* 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 mozilla_dom_audiochannelservicechild_h__ +#define mozilla_dom_audiochannelservicechild_h__ + +#include "nsAutoPtr.h" +#include "nsISupports.h" + +#include "AudioChannelService.h" +#include "AudioChannelCommon.h" +#include "nsHTMLMediaElement.h" + +namespace mozilla { +namespace dom { + +class AudioChannelServiceChild : public AudioChannelService +{ +public: + + /** + * Returns the AudioChannelServce singleton. Only to be called from main thread. + * @return NS_OK on proper assignment, NS_ERROR_FAILURE otherwise. + */ + static AudioChannelService* + GetAudioChannelService(); + + static void Shutdown(); + + virtual void RegisterMediaElement(nsHTMLMediaElement* aMediaElement, + AudioChannelType aType); + virtual void UnregisterMediaElement(nsHTMLMediaElement* aMediaElement); + + /** + * Return true if this type + this mozHidden should be muted. + */ + virtual bool GetMuted(AudioChannelType aType, bool aMozHidden); + +protected: + AudioChannelServiceChild(); + virtual ~AudioChannelServiceChild(); +}; + +} // namespace dom +} // namespace mozilla + +#endif + diff --git a/dom/audiochannel/Makefile.in b/dom/audiochannel/Makefile.in index 2c1ea1778a2d..2b3b141d1b03 100644 --- a/dom/audiochannel/Makefile.in +++ b/dom/audiochannel/Makefile.in @@ -32,10 +32,12 @@ EXPORTS_NAMESPACES = \ $(NULL) EXPORTS = AudioChannelService.h \ + AudioChannelServiceChild.h \ AudioChannelCommon.h CPPSRCS += \ AudioChannelService.cpp \ + AudioChannelServiceChild.cpp \ $(NULL) include $(topsrcdir)/config/config.mk diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index b521fd9c981b..57a4a5612d5c 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -98,6 +98,7 @@ #include "nsContentUtils.h" #include "nsIPrincipal.h" #include "nsDeviceStorage.h" +#include "AudioChannelService.h" using namespace base; using namespace mozilla::docshell; @@ -431,6 +432,17 @@ ContentChild::RecvPMemoryReportRequestConstructor(PMemoryReportRequestChild* chi return true; } +bool +ContentChild::RecvAudioChannelNotify() +{ + nsRefPtr service = + AudioChannelService::GetAudioChannelService(); + if (service) { + service->Notify(); + } + return true; +} + bool ContentChild::DeallocPMemoryReportRequest(PMemoryReportRequestChild* actor) { diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index 5eaadda8b609..9ca8d1ebb41f 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -111,6 +111,9 @@ public: virtual bool RecvPMemoryReportRequestConstructor(PMemoryReportRequestChild* child); + virtual bool + RecvAudioChannelNotify(); + virtual bool RecvDumpMemoryReportsToFile(const nsString& aIdentifier, const bool& aMinimizeMemoryUsage, diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 18227991c84e..e939af3fb1cb 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -16,6 +16,7 @@ #include "chrome/common/process_watcher.h" #include "AppProcessPermissions.h" +#include "AudioChannelService.h" #include "CrashReporterParent.h" #include "IHistory.h" #include "IDBFactory.h" @@ -1011,6 +1012,42 @@ ContentParent::RecvFirstIdle() return true; } +bool +ContentParent::RecvAudioChannelGetMuted(const AudioChannelType& aType, + const bool& aMozHidden, + bool* aValue) +{ + nsRefPtr service = + AudioChannelService::GetAudioChannelService(); + *aValue = false; + if (service) { + *aValue = service->GetMuted(aType, aMozHidden); + } + return true; +} + +bool +ContentParent::RecvAudioChannelRegisterType(const AudioChannelType& aType) +{ + nsRefPtr service = + AudioChannelService::GetAudioChannelService(); + if (service) { + service->RegisterType(aType); + } + return true; +} + +bool +ContentParent::RecvAudioChannelUnregisterType(const AudioChannelType& aType) +{ + nsRefPtr service = + AudioChannelService::GetAudioChannelService(); + if (service) { + service->UnregisterType(aType); + } + return true; +} + NS_IMPL_THREADSAFE_ISUPPORTS3(ContentParent, nsIObserver, nsIThreadObserver, diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index b8d08f5be2fe..17606ad27c1a 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -261,7 +261,7 @@ private: virtual bool RecvSetURITitle(const URIParams& uri, const nsString& title); - + virtual bool RecvShowFilePicker(const int16_t& mode, const int16_t& selectedType, const bool& addToRecentDocs, @@ -273,7 +273,7 @@ private: InfallibleTArray* files, int16_t* retValue, nsresult* result); - + virtual bool RecvShowAlertNotification(const nsString& aImageUrl, const nsString& aTitle, const nsString& aText, const bool& aTextClickable, const nsString& aCookie, const nsString& aName); @@ -302,6 +302,13 @@ private: virtual bool RecvFirstIdle(); + virtual bool RecvAudioChannelGetMuted(const AudioChannelType& aType, + const bool& aMozHidden, + bool* aValue); + + virtual bool RecvAudioChannelRegisterType(const AudioChannelType& aType); + virtual bool RecvAudioChannelUnregisterType(const AudioChannelType& aType); + virtual void ProcessingError(Result what) MOZ_OVERRIDE; GeckoChildProcessHost* mSubprocess; diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 4c7194e51222..5230cd367b2e 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -38,6 +38,7 @@ using OverrideMapping; using IPC::Permission; using mozilla::null_t; using mozilla::void_t; +using mozilla::dom::AudioChannelType; using mozilla::dom::NativeThreadId; using mozilla::layout::ScrollingBehavior; using gfxIntSize; @@ -264,6 +265,11 @@ both: child: PMemoryReportRequest(); + /** + * Notify the AudioChannelService in the child processes. + */ + async AudioChannelNotify(); + /** * Dump the contents of about:memory to a file in our temp directory. * @@ -424,6 +430,13 @@ parent: // Tell the parent that the child has gone idle for the first time async FirstIdle(); + // Get Muted from the main AudioChannelService. + sync AudioChannelGetMuted(AudioChannelType aType, bool aMozHidden) + returns (bool value); + + async AudioChannelRegisterType(AudioChannelType aType); + async AudioChannelUnregisterType(AudioChannelType aType); + both: AsyncMessage(nsString aMessage, ClonedMessageData aData); }; diff --git a/dom/ipc/TabMessageUtils.h b/dom/ipc/TabMessageUtils.h index e169460215c4..1509926ccdc0 100644 --- a/dom/ipc/TabMessageUtils.h +++ b/dom/ipc/TabMessageUtils.h @@ -6,6 +6,7 @@ #ifndef TABMESSAGE_UTILS_H #define TABMESSAGE_UTILS_H +#include "AudioChannelCommon.h" #include "ipc/IPCMessageUtils.h" #include "nsIDOMEvent.h" #include "nsCOMPtr.h" @@ -56,6 +57,13 @@ struct ParamTraits } }; +template <> +struct ParamTraits + : public EnumSerializer +{ }; + } diff --git a/dom/plugins/test/mochitest/Makefile.in b/dom/plugins/test/mochitest/Makefile.in index 03e17725e968..fbc9bf5ade58 100644 --- a/dom/plugins/test/mochitest/Makefile.in +++ b/dom/plugins/test/mochitest/Makefile.in @@ -99,11 +99,16 @@ MOCHITEST_CHROME_FILES = \ utils.js \ test_clear_site_data.html \ test_npruntime.xul \ - test_privatemode.xul \ test_wmode.xul \ test_bug479979.xul \ $(NULL) +ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING +MOCHITEST_CHROME_FILES += \ + test_privatemode.xul \ + $(NULL) +endif + ifneq ($(MOZ_WIDGET_TOOLKIT),cocoa) MOCHITEST_FILES += \ test_instance_re-parent-windowed.html \ diff --git a/dom/tests/browser/Makefile.in b/dom/tests/browser/Makefile.in index 2458b5ec5e09..1d17cd14e485 100644 --- a/dom/tests/browser/Makefile.in +++ b/dom/tests/browser/Makefile.in @@ -17,12 +17,17 @@ MOCHITEST_BROWSER_FILES := \ browser_ConsoleAPITests.js \ test-console-api.html \ browser_ConsoleStorageAPITests.js \ - browser_ConsoleStoragePBTest.js \ browser_autofocus_preference.js \ browser_bug396843.js \ browser_xhr_sandbox.js \ $(NULL) +ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING +MOCHITEST_BROWSER_FILES += \ + browser_ConsoleStoragePBTest.js \ + $(NULL) +endif + ifeq (Linux,$(OS_ARCH)) MOCHITEST_BROWSER_FILES += \ browser_webapps_permissions.js \ diff --git a/dom/tests/mochitest/localstorage/Makefile.in b/dom/tests/mochitest/localstorage/Makefile.in index a7f26adb428c..85b18f4fa9fa 100644 --- a/dom/tests/mochitest/localstorage/Makefile.in +++ b/dom/tests/mochitest/localstorage/Makefile.in @@ -39,7 +39,6 @@ MOCHITEST_FILES = \ test_embededNulls.html \ test_keySync.html \ test_localStorageBase.html \ - test_localStorageBasePrivateBrowsing.html \ test_localStorageBaseSessionOnly.html \ test_localStorageCookieSettings.html \ test_localStorageEnablePref.html \ @@ -50,13 +49,19 @@ MOCHITEST_FILES = \ test_localStorageOriginsSchemaDiffs.html \ test_localStorageReplace.html \ test_localStorageQuota.html \ - test_localStorageQuotaPrivateBrowsing.html \ test_localStorageQuotaSessionOnly.html \ test_localStorageQuotaSessionOnly2.html \ test_localStorageKeyOrder.html \ test_storageConstructor.html \ $(NULL) +ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING +MOCHITEST_FILES += \ + test_localStorageBasePrivateBrowsing.html \ + test_localStorageQuotaPrivateBrowsing.html \ + $(NULL) +endif + MOCHITEST_CHROME_FILES = \ test_localStorageFromChrome.xhtml \ test_app_uninstall.html \ diff --git a/extensions/cookie/test/unit/xpcshell.ini b/extensions/cookie/test/unit/xpcshell.ini index c09ccc1dbcad..a8c410fc6423 100644 --- a/extensions/cookie/test/unit/xpcshell.ini +++ b/extensions/cookie/test/unit/xpcshell.ini @@ -3,6 +3,7 @@ head = head_cookies.js tail = [test_bug468700.js] +skip-if = perwindowprivatebrowsing [test_bug526789.js] [test_bug650522.js] [test_bug667087.js] diff --git a/layout/forms/test/Makefile.in b/layout/forms/test/Makefile.in index 9167c472a30f..52c7629c490c 100644 --- a/layout/forms/test/Makefile.in +++ b/layout/forms/test/Makefile.in @@ -47,10 +47,15 @@ MOCHITEST_FILES = test_bug231389.html \ $(NULL) MOCHITEST_CHROME_FILES = \ - test_bug536567.html \ bug536567_subframe.html \ test_bug665540.html \ bug665540_window.xul \ $(NULL) +ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING +MOCHITEST_CHROME_FILES += \ + test_bug536567.html \ + $(NULL) +endif + include $(topsrcdir)/config/rules.mk diff --git a/security/manager/ssl/tests/mochitest/stricttransportsecurity/Makefile.in b/security/manager/ssl/tests/mochitest/stricttransportsecurity/Makefile.in index 3deaa96e3454..8327379253a3 100644 --- a/security/manager/ssl/tests/mochitest/stricttransportsecurity/Makefile.in +++ b/security/manager/ssl/tests/mochitest/stricttransportsecurity/Makefile.in @@ -19,7 +19,12 @@ MOCHITEST_FILES = \ nosts_bootstrap.html^headers^ \ verify.sjs \ test_stricttransportsecurity.html \ - test_sts_privatebrowsing.html \ $(NULL) +ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING +MOCHITEST_FILES += \ + test_sts_privatebrowsing.html \ + $(NULL) +endif + include $(topsrcdir)/config/rules.mk diff --git a/security/manager/ssl/tests/unit/xpcshell.ini b/security/manager/ssl/tests/unit/xpcshell.ini index 28b7f85e1fb8..c1889b5d5d3a 100644 --- a/security/manager/ssl/tests/unit/xpcshell.ini +++ b/security/manager/ssl/tests/unit/xpcshell.ini @@ -13,5 +13,7 @@ skip-if = os == "android" # Bug 676972: test hangs consistently on Android skip-if = os == "android" [test_bug627234.js] +skip-if = perwindowprivatebrowsing [test_sts_preloadlist.js] +skip-if = perwindowprivatebrowsing [test_sts_preloadlist_selfdestruct.js] diff --git a/toolkit/components/passwordmgr/test/Makefile.in b/toolkit/components/passwordmgr/test/Makefile.in index 8552ab45bd59..0094e67f1e20 100644 --- a/toolkit/components/passwordmgr/test/Makefile.in +++ b/toolkit/components/passwordmgr/test/Makefile.in @@ -53,7 +53,6 @@ MOCHITEST_FILES = \ test_maxforms_3.html \ test_notifications.html \ test_notifications_popup.html \ - test_privbrowsing.html \ test_prompt_async.html \ test_xhr.html \ test_xml_load.html \ @@ -83,11 +82,17 @@ MOCHITEST_FILES = \ subtst_prompt_async.html \ $(NULL) +ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING +MOCHITEST_FILES += \ + test_privbrowsing.html \ + $(NULL) + ifneq ($(OS_TARGET),Linux) MOCHITEST_FILES += \ test_prompt.html \ $(NULL) endif +endif # This test doesn't pass because we can't ensure a cross-platform # event that occurs between DOMContentLoaded and Pageload diff --git a/toolkit/components/places/tests/Makefile.in b/toolkit/components/places/tests/Makefile.in index 485266e6fa38..a0709be3d583 100644 --- a/toolkit/components/places/tests/Makefile.in +++ b/toolkit/components/places/tests/Makefile.in @@ -33,8 +33,13 @@ XPCSHELL_TESTS_COMMON = \ # Simple MochiTests MOCHITEST_FILES = \ mochitest/test_bug_411966.html \ + $(NULL) + +ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING +MOCHITEST_FILES += \ mochitest/test_bug_461710.html \ $(NULL) +endif DIRS = \ chrome \ diff --git a/toolkit/components/places/tests/browser/Makefile.in b/toolkit/components/places/tests/browser/Makefile.in index 73f8edf55f50..e65f9c21185f 100644 --- a/toolkit/components/places/tests/browser/Makefile.in +++ b/toolkit/components/places/tests/browser/Makefile.in @@ -22,7 +22,6 @@ MOCHITEST_BROWSER_FILES = \ browser_redirect.js \ browser_visituri.js \ browser_visituri_nohistory.js \ - browser_visituri_privatebrowsing.js \ browser_settitle.js \ colorAnalyzer/category-discover.png \ colorAnalyzer/dictionaryGeneric-16.png \ @@ -34,6 +33,10 @@ ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING MOCHITEST_BROWSER_FILES += \ browser_bug248970.js \ $(NULL) +else +MOCHITEST_BROWSER_FILES += \ + browser_visituri_privatebrowsing.js \ + $(NULL) endif # These are files that need to be loaded via the HTTP proxy server diff --git a/toolkit/components/places/tests/favicons/xpcshell.ini b/toolkit/components/places/tests/favicons/xpcshell.ini index 5efc35cd6ca2..d6b18f4f3758 100644 --- a/toolkit/components/places/tests/favicons/xpcshell.ini +++ b/toolkit/components/places/tests/favicons/xpcshell.ini @@ -16,6 +16,8 @@ fail-if = os == "android" [test_replaceFaviconData.js] [test_replaceFaviconDataFromDataURL.js] [test_setAndFetchFaviconForPage.js] +skip-if = perwindowprivatebrowsing [test_setAndFetchFaviconForPage_failures.js] # Bug 676989: test fails consistently on Android fail-if = os == "android" +skip-if = perwindowprivatebrowsing diff --git a/toolkit/components/satchel/test/Makefile.in b/toolkit/components/satchel/test/Makefile.in index 9c9007d991a4..c2cae96c342c 100644 --- a/toolkit/components/satchel/test/Makefile.in +++ b/toolkit/components/satchel/test/Makefile.in @@ -25,11 +25,16 @@ MOCHITEST_FILES = \ test_form_submission.html \ test_form_submission_cap.html \ test_form_submission_cap2.html \ - test_privbrowsing.html \ satchel_common.js \ subtst_form_submission_1.html \ subtst_privbrowsing.html \ $(NULL) +ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING +MOCHITEST_FILES += \ + test_privbrowsing.html \ + $(NULL) +endif + include $(topsrcdir)/config/rules.mk diff --git a/toolkit/mozapps/update/test/unit/xpcshell.ini b/toolkit/mozapps/update/test/unit/xpcshell.ini index 8ef90c05d136..ec91d3bd9bf9 100644 --- a/toolkit/mozapps/update/test/unit/xpcshell.ini +++ b/toolkit/mozapps/update/test/unit/xpcshell.ini @@ -27,5 +27,6 @@ run-if = os == 'win' [include:xpcshell_updater_xp_unix.ini] run-if = os == 'linux' || os == 'mac' || os == 'sunos' [test_bug497578.js] +skip-if = perwindowprivatebrowsing [test_bug595059.js] [test_bug794211.js]