1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/urlformatter/tests/unit/head_urlformatter.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,41 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 +const Cc = Components.classes; 1.8 +const Ci = Components.interfaces; 1.9 +const Cr = Components.results; 1.10 + 1.11 +var XULAppInfo = { 1.12 + vendor: "Mozilla", 1.13 + name: "Url Formatter Test", 1.14 + ID: "urlformattertest@test.mozilla.org", 1.15 + version: "1", 1.16 + appBuildID: "2007122405", 1.17 + platformVersion: "2.0", 1.18 + platformBuildID: "2007122406", 1.19 + inSafeMode: false, 1.20 + logConsoleErrors: true, 1.21 + OS: "XPCShell", 1.22 + XPCOMABI: "noarch-spidermonkey", 1.23 + 1.24 + QueryInterface: function QueryInterface(iid) { 1.25 + if (iid.equals(Ci.nsIXULAppInfo) || 1.26 + iid.equals(Ci.nsIXULRuntime) || 1.27 + iid.equals(Ci.nsISupports)) 1.28 + return this; 1.29 + throw Cr.NS_ERROR_NO_INTERFACE; 1.30 + } 1.31 +}; 1.32 + 1.33 +var XULAppInfoFactory = { 1.34 + createInstance: function (outer, iid) { 1.35 + if (outer != null) 1.36 + throw Cr.NS_ERROR_NO_AGGREGATION; 1.37 + return XULAppInfo.QueryInterface(iid); 1.38 + } 1.39 +}; 1.40 + 1.41 +var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); 1.42 +registrar.registerFactory(Components.ID("{ecff8849-cee8-40a7-bd4a-3f4fdfeddb5c}"), 1.43 + "XULAppInfo", "@mozilla.org/xre/app-info;1", 1.44 + XULAppInfoFactory);