45 строки
1.2 KiB
JavaScript
45 строки
1.2 KiB
JavaScript
/**
|
|
* Mac specific version of testing the platformIsMac part of
|
|
* steelIApplication.
|
|
*/
|
|
|
|
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
|
|
const Ci = Components.interfaces;
|
|
const Cc = Components.classes;
|
|
|
|
var XULAppInfo = {
|
|
vendor: "Mozilla",
|
|
name: "XPCShell",
|
|
ID: "{39885e5f-f6b4-4e2a-87e5-6259ecf79011}",
|
|
version: "5",
|
|
appBuildID: "2007010101",
|
|
platformVersion: "1.9",
|
|
platformBuildID: "2007010101",
|
|
inSafeMode: false,
|
|
logConsoleErrors: true,
|
|
OS: "XPCShell",
|
|
XPCOMABI: "noarch-spidermonkey",
|
|
|
|
QueryInterface: XPCOMUtils.generateQI([Ci.nsIXULAppInfo, Ci.nsIXULRuntime,
|
|
Ci.nsISupports])
|
|
};
|
|
|
|
var XULAppInfoFactory = {
|
|
createInstance: function (outer, iid) {
|
|
if (outer != null)
|
|
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
|
return XULAppInfo.QueryInterface(iid);
|
|
}
|
|
};
|
|
|
|
function run_test() {
|
|
Components.manager.QueryInterface(Ci.nsIComponentRegistrar)
|
|
.registerFactory(Components.ID("{48a4e946-1f9f-4224-b4b0-9a54183cb81e}"),
|
|
"XULAppInfo", "@mozilla.org/xre/app-info;1",
|
|
XULAppInfoFactory);
|
|
|
|
do_check_true(Cc["@mozilla.org/steel/application;1"]
|
|
.getService(Ci.steelIApplication).platformIsMac);
|
|
}
|