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

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

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

mercurial