Bug 901030 - dbg blackbox command reports all the same source black boxed; r=dcamp

This commit is contained in:
Nick Fitzgerald 2013-08-02 17:09:37 -07:00
parent 9e52ba7379
commit 8177c115bc
2 changed files with 14 additions and 6 deletions

View File

@ -506,11 +506,12 @@ gcli.addCommand({
const blackBoxed = [];
for (let source of toBlackBox) {
let { url } = source;
activeThread.source(source)[cmd.clientMethod](function ({ error }) {
if (error) {
blackBoxed.push(lookup("ErrorDesc") + " " + source.url);
blackBoxed.push(lookup("ErrorDesc") + " " + url);
} else {
blackBoxed.push(source.url);
blackBoxed.push(url);
}
if (toBlackBox.length === blackBoxed.length) {

View File

@ -20,7 +20,7 @@ let gClient;
let gThreadClient;
let gTab;
function cmd(typed, expectedNumEvents=1) {
function cmd(typed, expectedNumEvents=1, output=null) {
const deferred = promise.defer();
let timesFired = 0;
@ -31,10 +31,16 @@ function cmd(typed, expectedNumEvents=1) {
}
});
helpers.audit(gOptions, [{
let audit = {
setup: typed,
exec: {}
}]);
};
if (output) {
audit.output = output;
}
helpers.audit(gOptions, [audit]);
return deferred.promise;
}
@ -93,7 +99,8 @@ function testUnBlackBoxSource() {
}
function testBlackBoxGlob() {
return cmd("dbg blackbox --glob *blackboxing_t*.js", 2)
return cmd("dbg blackbox --glob *blackboxing_t*.js", 2,
[/blackboxing_three\.js/g, /blackboxing_two\.js/g])
.then(function () {
ok(getBlackBoxCheckbox(BLACKBOXME_URL).checked,
"blackboxme should not be black boxed because it doesn't match the glob");