tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_db_format_pref_new.js (1080B)


      1 // -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
      2 // This Source Code Form is subject to the terms of the Mozilla Public
      3 // License, v. 2.0. If a copy of the MPL was not distributed with this
      4 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
      5 "use strict";
      6 
      7 // Tests that when PSM initializes, we create the sqlite-backed certificate and
      8 // key databases.
      9 
     10 function run_test() {
     11  let profileDir = do_get_profile();
     12  let certificateDBFile = profileDir.clone();
     13  let certificateDBName = "cert9.db";
     14  certificateDBFile.append(certificateDBName);
     15  ok(
     16    !certificateDBFile.exists(),
     17    `${certificateDBName} should not exist beforehand`
     18  );
     19  let keyDBFile = profileDir.clone();
     20  let keyDBName = "key4.db";
     21  keyDBFile.append(keyDBName);
     22  ok(!keyDBFile.exists(), `${keyDBName} should not exist beforehand`);
     23  // This should start PSM.
     24  Cc["@mozilla.org/psm;1"].getService(Ci.nsISupports);
     25  ok(
     26    certificateDBFile.exists(),
     27    `${certificateDBName} should exist in the profile`
     28  );
     29  ok(keyDBFile.exists(), `${keyDBName} should exist in the profile`);
     30 }