toolkit/components/urlformatter/tests/unit/head_urlformatter.js

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     4 const Cc = Components.classes;
     5 const Ci = Components.interfaces;
     6 const Cr = Components.results;
     8 var XULAppInfo = {
     9   vendor: "Mozilla",
    10   name: "Url Formatter Test",
    11   ID: "urlformattertest@test.mozilla.org",
    12   version: "1",
    13   appBuildID: "2007122405",
    14   platformVersion: "2.0",
    15   platformBuildID: "2007122406",
    16   inSafeMode: false,
    17   logConsoleErrors: true,
    18   OS: "XPCShell",
    19   XPCOMABI: "noarch-spidermonkey",
    21   QueryInterface: function QueryInterface(iid) {
    22     if (iid.equals(Ci.nsIXULAppInfo) ||
    23         iid.equals(Ci.nsIXULRuntime) ||
    24         iid.equals(Ci.nsISupports))
    25       return this;
    26     throw Cr.NS_ERROR_NO_INTERFACE;
    27   }
    28 };
    30 var XULAppInfoFactory = {
    31   createInstance: function (outer, iid) {
    32     if (outer != null)
    33       throw Cr.NS_ERROR_NO_AGGREGATION;
    34     return XULAppInfo.QueryInterface(iid);
    35   }
    36 };
    38 var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
    39 registrar.registerFactory(Components.ID("{ecff8849-cee8-40a7-bd4a-3f4fdfeddb5c}"),
    40                           "XULAppInfo", "@mozilla.org/xre/app-info;1",
    41                           XULAppInfoFactory);

mercurial