toolkit/components/places/tests/migration/test_database_from_alpha.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

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

mercurial