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

Wed, 31 Dec 2014 07:53:36 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:53:36 +0100
branch
TOR_BUG_3246
changeset 5
4ab42b5ab56c
permissions
-rw-r--r--

Correct small whitespace inconsistency, lost while renaming variables.

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

mercurial