diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml
index 568736b19549..a733fbfc854c 100644
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 4b3490781e2e..27b026f895bc 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 5cb19934eba7..1a87af64f2cf 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 1836c87a2538..c54ef6862690 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator-l/sources.xml b/b2g/config/emulator-l/sources.xml
index 10eac1869dc8..d1e309beb981 100644
--- a/b2g/config/emulator-l/sources.xml
+++ b/b2g/config/emulator-l/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 4b3490781e2e..27b026f895bc 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml
index 3033be36d474..65b915c665be 100644
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index e0ff847c5886..d38c404f136b 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 50e1cf25cc16..75a3ad824ea2 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
{
"git": {
- "git_revision": "2fb09da0cb9cefad9c6e40f57533fafda6d12557",
+ "git_revision": "f6a1fcd30ee6a286f3bca9d0c3cb600e21bfbf69",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
- "revision": "82758e5ede4ffa620385685078202fcef4e08760",
+ "revision": "96b7e916f53ebcd185b087338913edb5ffdadade",
"repo_path": "integration/gaia-central"
}
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index b876a17f33c7..1cf9fe4c5cee 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/nexus-5-l/sources.xml b/b2g/config/nexus-5-l/sources.xml
index bc138e3d5baa..20671f976354 100644
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in
index d35382ee5d8f..b85525308df7 100644
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -69,7 +69,6 @@
@BINPATH@/@DLL_PREFIX@plds4@DLL_SUFFIX@
@BINPATH@/@DLL_PREFIX@nspr4@DLL_SUFFIX@
#endif
-@BINPATH@/@DLL_PREFIX@mozalloc@DLL_SUFFIX@
#ifdef MOZ_DMD
@BINPATH@/@DLL_PREFIX@dmd@DLL_SUFFIX@
#endif
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
index c2e15b6bf51b..459b087d34a2 100644
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1202,9 +1202,14 @@ pref("security.sandbox.windows.log", false);
pref("dom.ipc.plugins.sandbox-level.default", 0);
#if defined(MOZ_CONTENT_SANDBOX)
-// This controls whether the Windows content process sandbox is using a more
-// strict sandboxing policy. This will require a restart.
-pref("security.sandbox.windows.content.moreStrict", false);
+// This controls the strength of the Windows content process sandbox for testing
+// purposes. This will require a restart.
+// On windows these levels are:
+// 0 - sandbox with USER_NON_ADMIN access token level
+// 1 - a more strict sandbox, which causes problems in specific areas
+// 2 - a policy that we can reasonably call an effective sandbox
+// 3 - an equivalent basic policy to the Chromium renderer processes
+pref("security.sandbox.content.level", 0);
#if defined(MOZ_STACKWALKING)
// This controls the depth of stack trace that is logged when Windows sandbox
@@ -1225,7 +1230,7 @@ pref("security.sandbox.windows.log.stackTraceDepth", 0);
// This setting is read when the content process is started. On Mac the content
// process is killed when all windows are closed, so a change will take effect
// when the 1st window is opened.
-pref("security.sandbox.macos.content.level", 0);
+pref("security.sandbox.content.level", 0);
#endif
// This pref governs whether we attempt to work around problems caused by
diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
index b3982d04542f..71ef386ab0fe 100644
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -67,7 +67,6 @@
#ifdef GKMEDIAS_SHARED_LIBRARY
@BINPATH@/@DLL_PREFIX@gkmedias@DLL_SUFFIX@
#endif
-@BINPATH@/@DLL_PREFIX@mozalloc@DLL_SUFFIX@
#ifdef MOZ_SHARED_MOZGLUE
@BINPATH@/@DLL_PREFIX@mozglue@DLL_SUFFIX@
#endif
diff --git a/build/gecko_templates.mozbuild b/build/gecko_templates.mozbuild
index 46ff7d2b456f..f8bbfca3cc43 100644
--- a/build/gecko_templates.mozbuild
+++ b/build/gecko_templates.mozbuild
@@ -32,12 +32,15 @@ def GeckoBinary(linkage='dependent', msvcrt='dynamic', mozglue=None):
xpcomglue = 'xpcomglue_staticruntime'
if not CONFIG['GNU_CC']:
mozglue = None
+ if linkage == 'dependent':
+ USE_LIBS += [
+ 'mozalloc_staticruntime',
+ ]
else:
error('msvcrt must be "dynamic" or "static"')
if linkage == 'dependent':
USE_LIBS += [
- 'mozalloc',
'nspr',
'%s_s' % xpcomglue,
'xul',
diff --git a/dom/base/nsCopySupport.cpp b/dom/base/nsCopySupport.cpp
index 8631b94b1c44..436b0f9f5489 100644
--- a/dom/base/nsCopySupport.cpp
+++ b/dom/base/nsCopySupport.cpp
@@ -50,6 +50,7 @@
#include "mozilla/EventDispatcher.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/Selection.h"
+#include "mozilla/IntegerRange.h"
using namespace mozilla;
using namespace mozilla::dom;
@@ -148,7 +149,8 @@ SelectionCopyHelper(nsISelection *aSel, nsIDocument *aDoc,
nsIDocumentEncoder::OutputAbsoluteLinks |
nsIDocumentEncoder::SkipInvisibleContent |
nsIDocumentEncoder::OutputDropInvisibleBreak |
- (aFlags & nsIDocumentEncoder::OutputNoScriptContent);
+ (aFlags & (nsIDocumentEncoder::OutputNoScriptContent |
+ nsIDocumentEncoder::OutputRubyAnnotation));
mimeType.AssignLiteral(kTextMime);
rv = docEncoder->Init(domDoc, mimeType, flags);
@@ -273,11 +275,13 @@ SelectionCopyHelper(nsISelection *aSel, nsIDocument *aDoc,
nsresult
nsCopySupport::HTMLCopy(nsISelection* aSel, nsIDocument* aDoc,
- int16_t aClipboardID)
+ int16_t aClipboardID, bool aWithRubyAnnotation)
{
- return SelectionCopyHelper(aSel, aDoc, true, aClipboardID,
- nsIDocumentEncoder::SkipInvisibleContent,
- nullptr);
+ uint32_t flags = nsIDocumentEncoder::SkipInvisibleContent;
+ if (aWithRubyAnnotation) {
+ flags |= nsIDocumentEncoder::OutputRubyAnnotation;
+ }
+ return SelectionCopyHelper(aSel, aDoc, true, aClipboardID, flags, nullptr);
}
nsresult
@@ -582,6 +586,38 @@ nsCopySupport::CanCopy(nsIDocument* aDocument)
return !isCollapsed;
}
+static bool
+IsInsideRuby(nsINode* aNode)
+{
+ for (; aNode; aNode = aNode->GetParent()) {
+ if (aNode->IsHTMLElement(nsGkAtoms::ruby)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+static bool
+IsSelectionInsideRuby(nsISelection* aSelection)
+{
+ int32_t rangeCount;
+ nsresult rv = aSelection->GetRangeCount(&rangeCount);
+ if (NS_FAILED(rv)) {
+ return false;
+ }
+ for (auto i : MakeRange(rangeCount)) {
+ nsCOMPtr range;
+ aSelection->GetRangeAt(i, getter_AddRefs(range));
+ nsCOMPtr node;
+ range->GetCommonAncestorContainer(getter_AddRefs(node));
+ nsCOMPtr n = do_QueryInterface(node);
+ if (!IsInsideRuby(n)) {
+ return false;
+ }
+ }
+ return true;
+}
+
bool
nsCopySupport::FireClipboardEvent(int32_t aType, int32_t aClipboardType, nsIPresShell* aPresShell, nsISelection* aSelection)
{
@@ -690,8 +726,13 @@ nsCopySupport::FireClipboardEvent(int32_t aType, int32_t aClipboardType, nsIPres
if (isCollapsed) {
return false;
}
+ // XXX Code which decides whether we should copy text with ruby
+ // annotation is currenct depending on whether each range of the
+ // selection is inside a same ruby container. But we really should
+ // expose the full functionality in browser. See bug 1130891.
+ bool withRubyAnnotation = IsSelectionInsideRuby(sel);
// call the copy code
- rv = HTMLCopy(sel, doc, aClipboardType);
+ rv = HTMLCopy(sel, doc, aClipboardType, withRubyAnnotation);
if (NS_FAILED(rv)) {
return false;
}
diff --git a/dom/base/nsCopySupport.h b/dom/base/nsCopySupport.h
index b8db3b48108b..15670a52198d 100644
--- a/dom/base/nsCopySupport.h
+++ b/dom/base/nsCopySupport.h
@@ -23,7 +23,8 @@ class nsCopySupport
{
// class of static helper functions for copy support
public:
- static nsresult HTMLCopy(nsISelection *aSel, nsIDocument *aDoc, int16_t aClipboardID);
+ static nsresult HTMLCopy(nsISelection *aSel, nsIDocument *aDoc,
+ int16_t aClipboardID, bool aWithRubyAnnotation);
static nsresult DoHooks(nsIDocument *aDoc, nsITransferable *aTrans,
bool *aDoPutOnClipboard);
diff --git a/dom/base/nsDocumentEncoder.cpp b/dom/base/nsDocumentEncoder.cpp
index 44ce139816bb..4021f3c46a2b 100644
--- a/dom/base/nsDocumentEncoder.cpp
+++ b/dom/base/nsDocumentEncoder.cpp
@@ -124,6 +124,11 @@ protected:
// We have already checked that our parent is visible.
return true;
}
+ if (aNode->IsHTMLElement(nsGkAtoms::rp)) {
+ // Ruby parentheses are part of ruby structure, hence
+ // shouldn't be stripped out even if it is not displayed.
+ return true;
+ }
return false;
}
bool isVisible = frame->StyleVisibility()->IsVisible();
diff --git a/dom/base/nsFrameMessageManager.cpp b/dom/base/nsFrameMessageManager.cpp
index 0f18550cbd0e..c7dfe8e6b6e5 100644
--- a/dom/base/nsFrameMessageManager.cpp
+++ b/dom/base/nsFrameMessageManager.cpp
@@ -1956,13 +1956,13 @@ NS_NewParentProcessMessageManager(nsIMessageBroadcaster** aResult)
nullptr,
MM_CHROME | MM_PROCESSMANAGER | MM_BROADCASTER);
nsFrameMessageManager::sParentProcessManager = mm;
- nsFrameMessageManager::NewProcessMessageManager(nullptr); // Create same process message manager.
+ nsFrameMessageManager::NewProcessMessageManager(false); // Create same process message manager.
return CallQueryInterface(mm, aResult);
}
nsFrameMessageManager*
-nsFrameMessageManager::NewProcessMessageManager(mozilla::dom::nsIContentParent* aProcess)
+nsFrameMessageManager::NewProcessMessageManager(bool aIsRemote)
{
if (!nsFrameMessageManager::sParentProcessManager) {
nsCOMPtr dummy =
@@ -1972,8 +1972,10 @@ nsFrameMessageManager::NewProcessMessageManager(mozilla::dom::nsIContentParent*
MOZ_ASSERT(nsFrameMessageManager::sParentProcessManager,
"parent process manager not created");
nsFrameMessageManager* mm;
- if (aProcess) {
- mm = new nsFrameMessageManager(aProcess,
+ if (aIsRemote) {
+ // Callback is set in ContentParent::InitInternal so that the process has
+ // already started when we send pending scripts.
+ mm = new nsFrameMessageManager(nullptr,
nsFrameMessageManager::sParentProcessManager,
MM_CHROME | MM_PROCESSMANAGER);
} else {
diff --git a/dom/base/nsFrameMessageManager.h b/dom/base/nsFrameMessageManager.h
index 7e2f1dd266fc..37f0ffd92a1e 100644
--- a/dom/base/nsFrameMessageManager.h
+++ b/dom/base/nsFrameMessageManager.h
@@ -225,7 +225,7 @@ public:
NS_DECL_NSIPROCESSCHECKER
static nsFrameMessageManager*
- NewProcessMessageManager(mozilla::dom::nsIContentParent* aProcess);
+ NewProcessMessageManager(bool aIsRemote);
nsresult ReceiveMessage(nsISupports* aTarget, const nsAString& aMessage,
bool aIsSync, const StructuredCloneData* aCloneData,
diff --git a/dom/base/nsGkAtomList.h b/dom/base/nsGkAtomList.h
index 6eca907de9d8..00abf58db3ee 100644
--- a/dom/base/nsGkAtomList.h
+++ b/dom/base/nsGkAtomList.h
@@ -826,6 +826,7 @@ GK_ATOM(onpagehide, "onpagehide")
GK_ATOM(onpageshow, "onpageshow")
GK_ATOM(onpaint, "onpaint")
GK_ATOM(onpairedstatuschanged, "onpairedstatuschanged")
+GK_ATOM(onpairingaborted, "onpairingaborted")
GK_ATOM(onpairingconfirmationreq, "onpairingconfirmationreq")
GK_ATOM(onpairingconsentreq, "onpairingconsentreq")
GK_ATOM(onpaste, "onpaste")
@@ -1014,8 +1015,10 @@ GK_ATOM(round, "round")
GK_ATOM(row, "row")
GK_ATOM(rows, "rows")
GK_ATOM(rowspan, "rowspan")
+GK_ATOM(rb, "rb")
GK_ATOM(rp, "rp")
GK_ATOM(rt, "rt")
+GK_ATOM(rtc, "rtc")
GK_ATOM(rtl, "rtl")
GK_ATOM(ruby, "ruby")
GK_ATOM(rubyBase, "ruby-base")
diff --git a/dom/base/nsIDocumentEncoder.idl b/dom/base/nsIDocumentEncoder.idl
index 155e5c375c6e..f983b87d2d9d 100644
--- a/dom/base/nsIDocumentEncoder.idl
+++ b/dom/base/nsIDocumentEncoder.idl
@@ -35,7 +35,7 @@ interface nsIDocumentEncoderNodeFixup : nsISupports
nsIDOMNode fixupNode(in nsIDOMNode aNode, out boolean aSerializeCloneKids);
};
-[scriptable, uuid(1158bd7e-a08b-4ff6-9417-6f99144cfccc)]
+[scriptable, uuid(e5ec69d7-eaa7-4de7-986b-455e17c7f71a)]
interface nsIDocumentEncoder : nsISupports
{
// Output methods flag bits. There are a frightening number of these,
@@ -234,6 +234,12 @@ interface nsIDocumentEncoder : nsISupports
*/
const unsigned long OutputForPlainTextClipboardCopy = (1 << 25);
+ /**
+ * Include ruby annotations and ruby parentheses in the output.
+ * PlainText output only.
+ */
+ const unsigned long OutputRubyAnnotation = (1 << 26);
+
/**
* Initialize with a pointer to the document and the mime type.
* @param aDocument Document to encode.
diff --git a/dom/base/nsPlainTextSerializer.cpp b/dom/base/nsPlainTextSerializer.cpp
index 875520ec271f..b9db9c7d268e 100644
--- a/dom/base/nsPlainTextSerializer.cpp
+++ b/dom/base/nsPlainTextSerializer.cpp
@@ -29,6 +29,7 @@ using namespace mozilla::dom;
#define PREF_STRUCTS "converter.html2txt.structs"
#define PREF_HEADER_STRATEGY "converter.html2txt.header_strategy"
+#define PREF_ALWAYS_INCLUDE_RUBY "converter.html2txt.always_include_ruby"
static const int32_t kTabSize=4;
static const int32_t kIndentSizeHeaders = 2; /* Indention of h1, if
@@ -92,6 +93,7 @@ nsPlainTextSerializer::nsPlainTextSerializer()
mStartedOutput = false;
mPreformattedBlockBoundary = false;
+ mWithRubyAnnotation = false; // will be read from pref and flag later
// initialize the tag stack to zero:
// The stack only ever contains pointers to static atoms, so they don't
@@ -188,6 +190,13 @@ nsPlainTextSerializer::Init(uint32_t aFlags, uint32_t aWrapColumn,
}
}
+ // The pref is default inited to false in libpref, but we use true
+ // as fallback value because we don't want to affect behavior in
+ // other places which use this serializer currently.
+ mWithRubyAnnotation =
+ Preferences::GetBool(PREF_ALWAYS_INCLUDE_RUBY, true) ||
+ (mFlags & nsIDocumentEncoder::OutputRubyAnnotation);
+
// XXX We should let the caller decide whether to do this or not
mFlags &= ~nsIDocumentEncoder::OutputNoFramesContent;
@@ -255,6 +264,19 @@ nsPlainTextSerializer::ShouldReplaceContainerWithPlaceholder(nsIAtom* aTag)
(aTag == nsGkAtoms::video);
}
+bool
+nsPlainTextSerializer::IsIgnorableRubyAnnotation(nsIAtom* aTag)
+{
+ if (mWithRubyAnnotation) {
+ return false;
+ }
+
+ return
+ aTag == nsGkAtoms::rp ||
+ aTag == nsGkAtoms::rt ||
+ aTag == nsGkAtoms::rtc;
+}
+
NS_IMETHODIMP
nsPlainTextSerializer::AppendText(nsIContent* aText,
int32_t aStartOffset,
@@ -440,6 +462,12 @@ nsPlainTextSerializer::DoOpenContainer(nsIAtom* aTag)
mIgnoredChildNodeLevel++;
return NS_OK;
}
+ if (IsIgnorableRubyAnnotation(aTag)) {
+ // Ignorable ruby annotation shouldn't be replaced by a placeholder
+ // character, neither any of its descendants.
+ mIgnoredChildNodeLevel++;
+ return NS_OK;
+ }
if (mFlags & nsIDocumentEncoder::OutputForPlainTextClipboardCopy) {
if (mPreformattedBlockBoundary && DoOutput()) {
@@ -780,6 +808,10 @@ nsPlainTextSerializer::DoCloseContainer(nsIAtom* aTag)
mIgnoredChildNodeLevel--;
return NS_OK;
}
+ if (IsIgnorableRubyAnnotation(aTag)) {
+ mIgnoredChildNodeLevel--;
+ return NS_OK;
+ }
if (mFlags & nsIDocumentEncoder::OutputForPlainTextClipboardCopy) {
if (DoOutput() && IsInPre() && IsElementBlock(mElement)) {
diff --git a/dom/base/nsPlainTextSerializer.h b/dom/base/nsPlainTextSerializer.h
index bb8347a60ddd..9d0f3e700879 100644
--- a/dom/base/nsPlainTextSerializer.h
+++ b/dom/base/nsPlainTextSerializer.h
@@ -113,6 +113,7 @@ private:
bool PopBool(nsTArray& aStack);
bool ShouldReplaceContainerWithPlaceholder(nsIAtom* aTag);
+ bool IsIgnorableRubyAnnotation(nsIAtom* aTag);
bool IsElementPreformatted(mozilla::dom::Element* aElement);
bool IsElementBlock(mozilla::dom::Element* aElement);
@@ -175,6 +176,9 @@ private:
bool mPreformattedBlockBoundary;
+ // Whether the output should include ruby annotations.
+ bool mWithRubyAnnotation;
+
nsString mURL;
int32_t mHeaderStrategy; /* Header strategy (pref)
0 = no indention
diff --git a/dom/base/nsTreeSanitizer.cpp b/dom/base/nsTreeSanitizer.cpp
index 5b4a36b042d8..721107c0ff20 100644
--- a/dom/base/nsTreeSanitizer.cpp
+++ b/dom/base/nsTreeSanitizer.cpp
@@ -106,8 +106,10 @@ nsIAtom** const kElementsHTML[] = {
&nsGkAtoms::pre,
&nsGkAtoms::progress,
&nsGkAtoms::q,
+ &nsGkAtoms::rb,
&nsGkAtoms::rp,
&nsGkAtoms::rt,
+ &nsGkAtoms::rtc,
&nsGkAtoms::ruby,
&nsGkAtoms::s,
&nsGkAtoms::samp,
diff --git a/dom/base/test/browser_messagemanager_loadprocessscript.js b/dom/base/test/browser_messagemanager_loadprocessscript.js
index f0c35cb0984b..fa2214d81cb6 100644
--- a/dom/base/test/browser_messagemanager_loadprocessscript.js
+++ b/dom/base/test/browser_messagemanager_loadprocessscript.js
@@ -18,27 +18,72 @@ function processScript() {
});
sendSyncMessage("ProcessTest:Loaded");
}
+let processScriptURL = "data:,(" + processScript.toString() + ")()";
-function test() {
- waitForExplicitFinish();
+let checkProcess = Task.async(function*(mm) {
+ let { target } = yield promiseMessage(mm, "ProcessTest:Loaded");
+ target.sendAsyncMessage("ProcessTest:Reply");
+ yield promiseMessage(target, "ProcessTest:Finished");
+ ok(true, "Saw process finished");
+});
- let replyCount = 0;
+function promiseMessage(messageManager, message) {
+ return new Promise(resolve => {
+ let listener = (msg) => {
+ messageManager.removeMessageListener(message, listener);
+ resolve(msg);
+ };
- function loadListener(msg) {
- replyCount++;
- msg.target.sendAsyncMessage("ProcessTest:Reply");
- }
-
- ppmm.addMessageListener("ProcessTest:Loaded", loadListener);
- ppmm.addMessageListener("ProcessTest:Finished", function finishListener(msg) {
- if (replyCount < ppmm.childCount) {
- return;
- }
- info("Got " + replyCount + " replies");
- ok(replyCount, "Got message reply");
- ppmm.removeMessageListener("ProcessTest:Loaded", loadListener);
- ppmm.removeMessageListener("ProcessTest:Finished", finishListener);
- finish();
- });
- ppmm.loadProcessScript("data:,(" + processScript.toString() + ")()", true);
+ messageManager.addMessageListener(message, listener);
+ })
}
+
+// Test that loading a process script loads in all existing processes
+add_task(function*() {
+ let checks = [];
+ for (let i = 0; i < ppmm.childCount; i++)
+ checks.push(checkProcess(ppmm.getChildAt(i)));
+
+ ppmm.loadProcessScript(processScriptURL, false);
+ yield Promise.all(checks);
+});
+
+// Test that loading a process script loads in new processes
+add_task(function*() {
+ // This test is only relevant in e10s
+ if (!gMultiProcessBrowser)
+ return;
+
+ is(ppmm.childCount, 2, "Should be two processes at this point");
+
+ // Load something in the main process
+ gBrowser.selectedBrowser.loadURI("about:robots");
+ yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+
+ // With no remote frames left we should be down to one process.
+ // However, stuff like remote thumbnails can cause a content
+ // process to exist nonetheless. This should be rare, though,
+ // so the test is useful most of the time.
+ if (ppmm.childCount == 1) {
+ let check = checkProcess(ppmm);
+ ppmm.loadProcessScript(processScriptURL, true);
+
+ // The main process should respond
+ yield check;
+
+ check = checkProcess(ppmm);
+ // Reset the default browser to start a new child process
+ gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, true);
+ gBrowser.selectedBrowser.loadURI("about:blank");
+ yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+
+ is(ppmm.childCount, 2, "Should be back to two processes at this point");
+
+ // The new process should have responded
+ yield check;
+
+ ppmm.removeDelayedProcessScript(processScriptURL);
+ } else {
+ info("Unable to finish test entirely");
+ }
+});
diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini
index c9abd049ef56..f5a79ef24990 100644
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -424,7 +424,6 @@ support-files = test_bug357450.js
[test_bug380418.html]
support-files = test_bug380418.html^headers^
[test_bug382113.html]
-skip-if = (os == 'mac' || os == 'win') && debug # bug 453969
[test_bug382871.html]
[test_bug384003.xhtml]
[test_bug390219.html]
diff --git a/dom/base/test/test_bug382113.html b/dom/base/test/test_bug382113.html
index 177efd1e3886..3cf6791520cd 100644
--- a/dom/base/test/test_bug382113.html
+++ b/dom/base/test/test_bug382113.html
@@ -7,6 +7,19 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=382113
Test for Bug 382113
+
Mozilla Bug 382113
@@ -16,22 +29,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=382113
onload="objectGotOnload = true;">
-
-
-
-