Bug 1010518 - Activate Task.Debugging.maintainStack on test suites. r=ted

This commit is contained in:
David Rajchenbach-Teller 2014-06-09 14:43:00 +02:00
parent 2b5b59d204
commit 95d7440f90
2 changed files with 4 additions and 8 deletions

View File

@ -94,6 +94,7 @@ function Tester(aTests, aDumper, aCallback) {
this.SimpleTest = simpleTestScope.SimpleTest;
this.MemoryStats = simpleTestScope.MemoryStats;
this.Task = Task;
this.Task.Debugging.maintainStack = true;
this.Promise = Components.utils.import("resource://gre/modules/Promise.jsm", null).Promise;
this.Assert = Components.utils.import("resource://testing-common/Assert.jsm", null).Assert;

View File

@ -1231,9 +1231,6 @@ function add_test(func) {
return func;
}
// We lazy import Task.jsm so we don't incur a run-time penalty for all tests.
let _Task;
/**
* Add a test function which is a Task function.
*
@ -1272,13 +1269,11 @@ let _Task;
* });
*/
function add_task(func) {
if (!_Task) {
let ns = {};
_Task = Components.utils.import("resource://gre/modules/Task.jsm", ns).Task;
}
_gTests.push([true, func]);
}
let _Task = Components.utils.import("resource://gre/modules/Task.jsm", {}).Task;
_Task.Debugging.maintainStack = true;
/**
* Runs the next test function from the list of async tests.