Bug 843479 - More logging for test_init_async_multiple_then_sync.js.

This commit is contained in:
David Rajchenbach-Teller 2013-02-25 09:07:17 -05:00
parent 9705cc157e
commit 5771db118a

View File

@ -36,26 +36,33 @@ function run_test() {
// Ensure that all asynchronous initializers eventually complete
let init_complete = function init_complete(i) {
do_print("init complete " + i);
do_check_true(pending[i]);
pending[i] = false;
numberPending--;
do_check_true(numberPending >= 0);
do_check_true(Services.search.isInitialized);
if (numberPending == 0) {
// Just check that we can access a list of engines.
let engines = Services.search.getEngines();
do_check_neq(engines, null);
// Wait a little before quitting: if some initializer is
// triggered twice, we want to catch that error.
do_timeout(1000, function() {
do_test_finished();
});
if (numberPending != 0) {
do_print("Still waiting for the following initializations: " + JSON.stringify(pending));
return;
}
do_print("All initializations have completed");
// Just check that we can access a list of engines.
let engines = Services.search.getEngines();
do_check_neq(engines, null);
do_print("Waiting a second before quitting");
// Wait a little before quitting: if some initializer is
// triggered twice, we want to catch that error.
do_timeout(1000, function() {
do_print("Test is complete");
do_test_finished();
});
};
// ... but don't wait for asynchronous initializations to complete
let engines = Services.search.getEngines();
do_check_neq(engines, null);
do_print("Synchronous part of the test complete");
}