toolkit/components/places/tests/unit/test_analyze.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/places/tests/unit/test_analyze.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +// Tests sqlite_sta1 table exists, it should be created by analyze.
     1.8 +// Since the bookmark roots are created when the DB is created (bug 704855),
     1.9 +// the table will contain data.
    1.10 +
    1.11 +function run_test() {
    1.12 +  do_test_pending();
    1.13 +
    1.14 +  let stmt = DBConn().createAsyncStatement(
    1.15 +    "SELECT ROWID FROM sqlite_stat1"
    1.16 +  );
    1.17 +  stmt.executeAsync({
    1.18 +    _gotResult: false,
    1.19 +    handleResult: function(aResultSet) {
    1.20 +      this._gotResult = true;
    1.21 +    },
    1.22 +    handleError: function(aError) {
    1.23 +      do_throw("Unexpected error (" + aError.result + "): " + aError.message);
    1.24 +    },
    1.25 +    handleCompletion: function(aReason) {
    1.26 +      do_check_true(this._gotResult);
    1.27 +       do_test_finished();
    1.28 +    }
    1.29 +  });
    1.30 +  stmt.finalize();
    1.31 +}

mercurial