mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 718817 - Tests for deleted passwords database migration. r=dolske
This commit is contained in:
parent
7566c55a51
commit
b46635199b
BIN
toolkit/components/passwordmgr/test/unit/data/signons-v4.sqlite
Normal file
BIN
toolkit/components/passwordmgr/test/unit/data/signons-v4.sqlite
Normal file
Binary file not shown.
Binary file not shown.
@ -14,7 +14,7 @@ const ENCTYPE_SDR = 1;
|
||||
|
||||
// Current schema version used by storage-mozStorage.js. This will need to be
|
||||
// kept in sync with the version there (or else the tests fail).
|
||||
const CURRENT_SCHEMA = 4;
|
||||
const CURRENT_SCHEMA = 5;
|
||||
|
||||
function run_test() {
|
||||
|
||||
@ -294,6 +294,37 @@ do_check_true(LoginTest.is_about_now(t2.timeCreated));
|
||||
do_check_true(LoginTest.is_about_now(t2.timeLastUsed));
|
||||
do_check_true(LoginTest.is_about_now(t2.timePasswordChanged));
|
||||
|
||||
|
||||
/* ========== 9 ========== */
|
||||
testnum++;
|
||||
testdesc = "Test upgrade from v4 storage"
|
||||
|
||||
LoginTest.copyFile("signons-v4.sqlite");
|
||||
// Sanity check the test file.
|
||||
dbConnection = LoginTest.openDB("signons-v4.sqlite");
|
||||
do_check_eq(4, dbConnection.schemaVersion);
|
||||
do_check_false(dbConnection.tableExists("moz_deleted_logins"));
|
||||
|
||||
storage = LoginTest.reloadStorage(OUTDIR, "signons-v4.sqlite");
|
||||
do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
|
||||
do_check_true(dbConnection.tableExists("moz_deleted_logins"));
|
||||
|
||||
|
||||
/* ========== 10 ========== */
|
||||
testnum++;
|
||||
testdesc = "Test upgrade from v4->v5->v4 storage"
|
||||
|
||||
LoginTest.copyFile("signons-v4v5.sqlite");
|
||||
// Sanity check the test file.
|
||||
dbConnection = LoginTest.openDB("signons-v4v5.sqlite");
|
||||
do_check_eq(4, dbConnection.schemaVersion);
|
||||
do_check_true(dbConnection.tableExists("moz_deleted_logins"));
|
||||
|
||||
storage = LoginTest.reloadStorage(OUTDIR, "signons-v4v5.sqlite");
|
||||
do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
|
||||
do_check_true(dbConnection.tableExists("moz_deleted_logins"));
|
||||
|
||||
|
||||
} catch (e) {
|
||||
throw "FAILED in test #" + testnum + " -- " + testdesc + ": " + e;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user