Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 var testnum = 0;
7 let iter;
9 function run_test()
10 {
11 do_test_pending();
12 iter = next_test();
13 iter.next();
14 }
16 function next_test()
17 {
18 try {
20 // ===== test init =====
21 var testfile = do_get_file("formhistory_v3v4.sqlite");
22 var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
24 // Cleanup from any previous tests or failures.
25 var destFile = profileDir.clone();
26 destFile.append("formhistory.sqlite");
27 if (destFile.exists())
28 destFile.remove(false);
30 testfile.copyTo(profileDir, "formhistory.sqlite");
31 do_check_eq(3, getDBVersion(testfile));
33 // ===== 1 =====
34 testnum++;
36 destFile = profileDir.clone();
37 destFile.append("formhistory.sqlite");
38 dbConnection = Services.storage.openUnsharedDatabase(destFile);
40 // check for upgraded schema.
41 do_check_eq(CURRENT_SCHEMA, FormHistory.schemaVersion);
43 // Check that the index was added
44 do_check_true(dbConnection.tableExists("moz_deleted_formhistory"));
45 dbConnection.close();
47 // check that an entry still exists
48 yield countEntries("name-A", "value-A",
49 function (num) {
50 do_check_true(num > 0);
51 do_test_finished();
52 }
53 );
55 } catch (e) {
56 throw "FAILED in test #" + testnum + " -- " + e;
57 }
58 }