browser/components/places/tests/unit/head_bookmarks.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: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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/. */
     6 const Ci = Components.interfaces;
     7 const Cc = Components.classes;
     8 const Cr = Components.results;
     9 const Cu = Components.utils;
    11 Cu.import("resource://gre/modules/Services.jsm");
    12 Cu.import("resource://gre/modules/LoadContextInfo.jsm");
    14 // Import common head.
    15 let (commonFile = do_get_file("../../../../../toolkit/components/places/tests/head_common.js", false)) {
    16   let uri = Services.io.newFileURI(commonFile);
    17   Services.scriptloader.loadSubScript(uri.spec, this);
    18 }
    20 // Put any other stuff relative to this test folder below.
    23 XPCOMUtils.defineLazyGetter(this, "PlacesUIUtils", function() {
    24   Cu.import("resource:///modules/PlacesUIUtils.jsm");
    25   return PlacesUIUtils;
    26 });
    29 const ORGANIZER_FOLDER_ANNO = "PlacesOrganizer/OrganizerFolder";
    30 const ORGANIZER_QUERY_ANNO = "PlacesOrganizer/OrganizerQuery";
    33 // Needed by some test that relies on having an app  registered.
    34 let (XULAppInfo = {
    35   vendor: "Mozilla",
    36   name: "PlacesTest",
    37   ID: "{230de50e-4cd1-11dc-8314-0800200c9a66}",
    38   version: "1",
    39   appBuildID: "2007010101",
    40   platformVersion: "",
    41   platformBuildID: "2007010101",
    42   inSafeMode: false,
    43   logConsoleErrors: true,
    44   OS: "XPCShell",
    45   XPCOMABI: "noarch-spidermonkey",
    47   QueryInterface: XPCOMUtils.generateQI([
    48     Ci.nsIXULAppInfo,
    49     Ci.nsIXULRuntime,
    50   ])
    51 }) {
    52   let XULAppInfoFactory = {
    53     createInstance: function (outer, iid) {
    54       if (outer != null)
    55         throw Cr.NS_ERROR_NO_AGGREGATION;
    56       return XULAppInfo.QueryInterface(iid);
    57     }
    58   };
    59   let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
    60   registrar.registerFactory(Components.ID("{fbfae60b-64a4-44ef-a911-08ceb70b9f31}"),
    61                             "XULAppInfo", "@mozilla.org/xre/app-info;1",
    62                             XULAppInfoFactory);
    63 }
    65 // Smart bookmarks constants.
    66 const SMART_BOOKMARKS_VERSION = 7;
    67 const SMART_BOOKMARKS_ON_TOOLBAR = 1;
    68 const SMART_BOOKMARKS_ON_MENU =  3; // Takes into account the additional separator.
    70 // Default bookmarks constants.
    71 const DEFAULT_BOOKMARKS_ON_TOOLBAR = 1;
    72 const DEFAULT_BOOKMARKS_ON_MENU = 1;

mercurial