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.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * This file tests migration replaces the database if schema version < 6. |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | add_test(function corrupt_database_not_exists() { |
michael@0 | 9 | let dbFile = gProfD.clone(); |
michael@0 | 10 | dbFile.append("places.sqlite.corrupt"); |
michael@0 | 11 | do_check_false(dbFile.exists()); |
michael@0 | 12 | run_next_test(); |
michael@0 | 13 | }); |
michael@0 | 14 | |
michael@0 | 15 | add_test(function database_is_valid() { |
michael@0 | 16 | do_check_eq(PlacesUtils.history.databaseStatus, |
michael@0 | 17 | PlacesUtils.history.DATABASE_STATUS_CORRUPT); |
michael@0 | 18 | do_check_eq(DBConn().schemaVersion, CURRENT_SCHEMA_VERSION); |
michael@0 | 19 | run_next_test(); |
michael@0 | 20 | }); |
michael@0 | 21 | |
michael@0 | 22 | add_test(function corrupt_database_exists() { |
michael@0 | 23 | let dbFile = gProfD.clone(); |
michael@0 | 24 | dbFile.append("places.sqlite.corrupt"); |
michael@0 | 25 | do_check_true(dbFile.exists()); |
michael@0 | 26 | run_next_test(); |
michael@0 | 27 | }); |
michael@0 | 28 | |
michael@0 | 29 | function run_test() |
michael@0 | 30 | { |
michael@0 | 31 | setPlacesDatabase("places_alpha.sqlite"); |
michael@0 | 32 | run_next_test(); |
michael@0 | 33 | } |
michael@0 | 34 |