Bug 559877: Fix timeout in test_bug559800.js. r=robstrong

This commit is contained in:
Dave Townsend 2010-04-26 11:41:20 -07:00
parent 001ba87379
commit 91ecf90f1a

View File

@ -9,6 +9,7 @@ const profileDir = gProfD.clone();
profileDir.append("extensions");
function run_test() {
do_test_pending();
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
var dest = profileDir.clone();
@ -25,36 +26,11 @@ function run_test() {
name: "Test Addon 1",
}, dest);
// Make it look like the detabase was created previously
Services.prefs.setIntPref("extensions.databaseSchema", 1);
startupManager(1);
do_test_pending();
run_test_1();
}
function end_test() {
do_test_finished();
}
function run_test_1() {
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
do_check_neq(a1, null);
do_check_eq(a1.version, "1.0");
let db = gProfD.clone();
db.append("extensions.sqlite");
db.remove(true);
shutdownManager();
// DB shutdown can be asynchronous, normally this isn't a problem but we
// can't delete it until it is closed.
do_execute_soon(check_test_1);
});
}
function check_test_1() {
startupManager(1, false);
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
do_check_neq(a1, null);
do_check_eq(a1.version, "1.0");
@ -64,6 +40,6 @@ function check_test_1() {
do_check_true(db.exists());
do_check_true(db.fileSize > 0);
end_test();
do_test_finished();
});
}