browser/components/places/tests/unit/test_browserGlue_bookmarkshtml.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim:set ts=2 sw=2 sts=2 et: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 /**
     8  * Tests that nsBrowserGlue correctly exports bookmarks.html at shutdown if
     9  * browser.bookmarks.autoExportHTML is set to true.
    10  */
    12 function run_test() {
    13   run_next_test();
    14 }
    16 add_task(function* () {
    17   remove_bookmarks_html();
    19   Services.prefs.setBoolPref("browser.bookmarks.autoExportHTML", true);
    20   do_register_cleanup(() => Services.prefs.clearUserPref("browser.bookmarks.autoExportHTML"));
    22   // Initialize nsBrowserGlue before Places.
    23   Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIBrowserGlue);
    25   // Initialize Places through the History Service.
    26   Cc["@mozilla.org/browser/nav-history-service;1"]
    27     .getService(Ci.nsINavHistoryService);
    29   Services.obs.addObserver(function observer() {
    30     Services.obs.removeObserver(observer, "profile-before-change");
    31     check_bookmarks_html();
    32   }, "profile-before-change", false);
    33 });

mercurial