mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1571793 - browser_startup.js and browser_startup_content.js should record the correct stacks with failures, r=johannh.
Differential Revision: https://phabricator.services.mozilla.com/D40839 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
a5446915fb
commit
e7ef747496
@ -186,12 +186,14 @@ add_task(async function() {
|
||||
.filter(c => c != "startupRecorder.js");
|
||||
}
|
||||
|
||||
function printStack(scriptType, name) {
|
||||
function getStack(scriptType, name) {
|
||||
if (scriptType == "modules") {
|
||||
info(Cu.getModuleImportStack(name));
|
||||
} else if (scriptType == "components") {
|
||||
info(componentStacks.get(name));
|
||||
return Cu.getModuleImportStack(name);
|
||||
}
|
||||
if (scriptType == "components") {
|
||||
return componentStacks.get(name);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
// This block only adds debug output to help find the next bugs to file,
|
||||
@ -207,7 +209,7 @@ add_task(async function() {
|
||||
if (!previous || !data[previous][scriptType].includes(f)) {
|
||||
info(`${scriptType} loaded ${phase}: ${f}`);
|
||||
if (kDumpAllStacks) {
|
||||
printStack(scriptType, f);
|
||||
info(getStack(scriptType, f));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -233,8 +235,8 @@ add_task(async function() {
|
||||
`should have no unexpected ${scriptType} loaded ${phase}`
|
||||
);
|
||||
for (let script of loadedList[scriptType]) {
|
||||
ok(false, `unexpected ${scriptType}: ${script}`);
|
||||
printStack(scriptType, script);
|
||||
let message = `unexpected ${scriptType}: ${script}`;
|
||||
record(false, message, undefined, getStack(scriptType, script));
|
||||
}
|
||||
is(
|
||||
whitelist[scriptType].size,
|
||||
@ -251,9 +253,11 @@ add_task(async function() {
|
||||
for (let scriptType in blacklist) {
|
||||
for (let file of blacklist[scriptType]) {
|
||||
let loaded = loadedList[scriptType].includes(file);
|
||||
ok(!loaded, `${file} is not allowed ${phase}`);
|
||||
if (loaded) {
|
||||
printStack(scriptType, file);
|
||||
let message = `${file} is not allowed ${phase}`;
|
||||
if (!loaded) {
|
||||
ok(true, message);
|
||||
} else {
|
||||
record(false, message, undefined, getStack(scriptType, file));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -207,12 +207,12 @@ add_task(async function() {
|
||||
);
|
||||
|
||||
for (let script of loadedList[scriptType]) {
|
||||
ok(
|
||||
record(
|
||||
false,
|
||||
`Unexpected ${scriptType} loaded during content process startup: ${script}`
|
||||
`Unexpected ${scriptType} loaded during content process startup: ${script}`,
|
||||
undefined,
|
||||
loadedInfo[scriptType][script]
|
||||
);
|
||||
info(`Stack that loaded ${script}:\n`);
|
||||
info(loadedInfo[scriptType][script]);
|
||||
}
|
||||
|
||||
is(
|
||||
@ -246,14 +246,12 @@ add_task(async function() {
|
||||
for (let script of blacklist[scriptType]) {
|
||||
let loaded = script in loadedInfo[scriptType];
|
||||
if (loaded) {
|
||||
ok(
|
||||
record(
|
||||
false,
|
||||
`Unexpected ${scriptType} loaded during content process startup: ${script}`
|
||||
`Unexpected ${scriptType} loaded during content process startup: ${script}`,
|
||||
undefined,
|
||||
loadedInfo[scriptType][script]
|
||||
);
|
||||
if (loadedInfo[scriptType][script]) {
|
||||
info(`Stack that loaded ${script}:\n`);
|
||||
info(loadedInfo[scriptType][script]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user