michael@0: /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 et: */ 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: /** michael@0: * Tests that nsBrowserGlue correctly exports bookmarks.html at shutdown if michael@0: * browser.bookmarks.autoExportHTML is set to true. michael@0: */ michael@0: michael@0: function run_test() { michael@0: run_next_test(); michael@0: } michael@0: michael@0: add_task(function* () { michael@0: remove_bookmarks_html(); michael@0: michael@0: Services.prefs.setBoolPref("browser.bookmarks.autoExportHTML", true); michael@0: do_register_cleanup(() => Services.prefs.clearUserPref("browser.bookmarks.autoExportHTML")); michael@0: michael@0: // Initialize nsBrowserGlue before Places. michael@0: Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIBrowserGlue); michael@0: michael@0: // Initialize Places through the History Service. michael@0: Cc["@mozilla.org/browser/nav-history-service;1"] michael@0: .getService(Ci.nsINavHistoryService); michael@0: michael@0: Services.obs.addObserver(function observer() { michael@0: Services.obs.removeObserver(observer, "profile-before-change"); michael@0: check_bookmarks_html(); michael@0: }, "profile-before-change", false); michael@0: });