michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // This file tests the openUnsharedDatabase function of mozIStorageService. michael@0: michael@0: function test_openUnsharedDatabase_file_DNE() michael@0: { michael@0: // the file should be created after calling michael@0: var db = getTestDB(); michael@0: do_check_false(db.exists()); michael@0: getService().openUnsharedDatabase(db); michael@0: do_check_true(db.exists()); michael@0: } michael@0: michael@0: function test_openUnsharedDatabase_file_exists() michael@0: { michael@0: // it should already exist from our last test michael@0: var db = getTestDB(); michael@0: do_check_true(db.exists()); michael@0: getService().openUnsharedDatabase(db); michael@0: do_check_true(db.exists()); michael@0: } michael@0: michael@0: var tests = [test_openUnsharedDatabase_file_DNE, michael@0: test_openUnsharedDatabase_file_exists]; michael@0: michael@0: function run_test() michael@0: { michael@0: for (var i = 0; i < tests.length; i++) michael@0: tests[i](); michael@0: michael@0: cleanup(); michael@0: } michael@0: