зеркало из https://github.com/mozilla/pjs.git
Bug 718817 - Tests for deleted passwords database migration. r=dolske
This commit is contained in:
Родитель
80342f9cf7
Коммит
1fca56aea3
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче