Bug 1139021 - Don't run extra collections in the parent process for the mochitest window leak detector. r=jmaher

This commit is contained in:
Andrew McCreight 2015-03-04 14:00:24 -08:00
Родитель 76ce9ce1fc
Коммит 4ffb27571d
2 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -17,6 +17,12 @@ this.EXPORTED_SYMBOLS = ["ContentCollector"];
var ContentCollector = {
init: function() {
let processType = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).processType;
if (processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
// In the main process, we handle triggering collections in browser-test.js
return;
}
let cpmm = Cc["@mozilla.org/childprocessmessagemanager;1"]
.getService(Ci.nsISyncMessageSender);
cpmm.addMessageListener("browser-test:collect-request", this);

Просмотреть файл

@ -291,6 +291,11 @@ Tester.prototype = {
Services.obs.removeObserver(this, "content-document-global-created");
this.Promise.Debugging.clearUncaughtErrorObservers();
this._treatUncaughtRejectionsAsFailures = false;
// In the main process, we print the ShutdownLeaksCollector message here.
let pid = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).processID;
dump("Completed ShutdownLeaks collections in process " + pid + "\n");
this.dumper.structuredLogger.info("TEST-START | Shutdown");
if (this.tests.length) {