toolkit/components/passwordmgr/test/unit/test_access_db_connection.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/passwordmgr/test/unit/test_access_db_connection.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,20 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +function run_test()
     1.8 +{
     1.9 +  // Make sure that the storage component exposes its database connection.
    1.10 +  let storage = LoginTest.initStorage(OUTDIR, "signons-empty.sqlite");
    1.11 +  do_check_true(storage instanceof Ci.nsIInterfaceRequestor);
    1.12 +  let db = storage.getInterface(Ci.mozIStorageConnection);
    1.13 +  do_check_neq(db, null);
    1.14 +  do_check_true(db.connectionReady);
    1.15 +
    1.16 +  // Make sure that the login manager exposes its the storage component's
    1.17 +  // database connection.
    1.18 +  let lm = Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
    1.19 +  do_check_true(lm instanceof Ci.nsIInterfaceRequestor);
    1.20 +  db = lm.getInterface(Ci.mozIStorageConnection);
    1.21 +  do_check_neq(db, null);
    1.22 +  do_check_true(db.connectionReady);
    1.23 +}

mercurial