forked from mirrors/gecko-dev
This patch was autogenerated by my decomponents.py
It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.
It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.
It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)
MozReview-Commit-ID: DeSHcClQ7cG
--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
95 lines
2.9 KiB
XML
95 lines
2.9 KiB
XML
<?xml version="1.0"?>
|
|
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
|
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
|
type="text/css"?>
|
|
<window title="GC/CC logging with child processes"
|
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
<script type="application/javascript"
|
|
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
|
|
|
<!-- test results are displayed in the html:body -->
|
|
<body xmlns="http://www.w3.org/1999/xhtml">
|
|
</body>
|
|
|
|
<!-- test code goes here -->
|
|
<script type="application/javascript"><![CDATA[
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
let numRemotes = 3;
|
|
let numReady = 0;
|
|
|
|
// Create some remote processes, and set up message-passing so that
|
|
// we know when each child is fully initialized.
|
|
let remotes = [];
|
|
SpecialPowers.pushPrefEnv({"set": [["dom.ipc.processCount", numRemotes]]},
|
|
function() {
|
|
for (let i = 0; i < numRemotes; i++) {
|
|
let w = remotes[i] = window.open("remote.xul", "", "chrome");
|
|
|
|
w.addEventListener("load", function loadHandler() {
|
|
w.removeEventListener("load", loadHandler);
|
|
let remoteBrowser = w.document.getElementById("remote");
|
|
let mm = remoteBrowser.messageManager;
|
|
mm.addMessageListener("test:ready", function readyHandler() {
|
|
mm.removeMessageListener("test:ready", readyHandler);
|
|
numReady++;
|
|
if (numReady == numRemotes) {
|
|
// All the remote processes are ready. Run test.
|
|
runTest();
|
|
}
|
|
});
|
|
mm.loadFrameScript("data:," + encodeURI("sendAsyncMessage('test:ready');"), true);
|
|
});
|
|
}
|
|
});
|
|
|
|
let dumper = Cc["@mozilla.org/memory-info-dumper;1"].
|
|
getService(Ci.nsIMemoryInfoDumper);
|
|
|
|
function runTest()
|
|
{
|
|
let numParents = 0;
|
|
let numChildren = 0;
|
|
dumper.dumpGCAndCCLogsToFile(
|
|
/* identifier: */ "test." + Date.now(),
|
|
/* allTraces: */ false,
|
|
/* childProcesses: */ true,
|
|
{
|
|
onDump: function(gcLog, ccLog, isParent) {
|
|
if (isParent) {
|
|
numParents++;
|
|
} else {
|
|
numChildren++;
|
|
}
|
|
checkAndRemoveLog(gcLog);
|
|
checkAndRemoveLog(ccLog);
|
|
},
|
|
onFinish: function() {
|
|
is(numParents, 1,
|
|
"GC/CC logs for the parent process");
|
|
is(numChildren, numRemotes,
|
|
"GC/CC logs for each child process");
|
|
cleanUpAndFinish();
|
|
}
|
|
});
|
|
}
|
|
|
|
function cleanUpAndFinish() {
|
|
// Close the remote processes.
|
|
for (let i = 0; i < numRemotes; i++) {
|
|
remotes[i].close();
|
|
}
|
|
SimpleTest.finish();
|
|
}
|
|
|
|
function checkAndRemoveLog(logFile) {
|
|
let name = logFile.path;
|
|
ok(logFile.exists(), "log file "+name+" exists");
|
|
ok(logFile.isFile(), "log file "+name+" is a regular file");
|
|
ok(logFile.fileSize > 0, "log file "+name+" is not empty");
|
|
logFile.remove(/* recursive: */ false);
|
|
}
|
|
|
|
]]></script>
|
|
</window>
|