2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-01-28 10:31:45 -08:00
|
|
|
|
|
|
|
function test() {
|
|
|
|
/** Tests for Services.jsm (Bug 512784) **/
|
|
|
|
ok(Services, "Services object exists");
|
|
|
|
checkServices();
|
|
|
|
}
|
|
|
|
|
2010-03-01 18:02:09 -08:00
|
|
|
function checkService(service, interface) {
|
|
|
|
ok(service in Services, "Services." + service + " exists");
|
|
|
|
ok(Services[service] instanceof interface, "Services." + service + " is an " + interface);
|
|
|
|
}
|
|
|
|
|
2010-01-28 10:31:45 -08:00
|
|
|
function checkServices() {
|
2012-01-16 17:18:29 -08:00
|
|
|
checkService("prefs", Ci.nsIPrefBranch);
|
2010-03-01 18:02:09 -08:00
|
|
|
checkService("prefs", Ci.nsIPrefService);
|
2010-07-21 16:56:15 -07:00
|
|
|
checkService("contentPrefs", Ci.nsIContentPrefService);
|
2010-03-01 18:02:09 -08:00
|
|
|
checkService("wm", Ci.nsIWindowMediator);
|
2010-10-28 15:00:50 -07:00
|
|
|
checkService("obs", Ci.nsIObserverService);
|
2010-03-01 18:02:09 -08:00
|
|
|
checkService("perms", Ci.nsIPermissionManager);
|
|
|
|
checkService("io", Ci.nsIIOService);
|
|
|
|
checkService("io", Ci.nsIIOService2);
|
|
|
|
checkService("appinfo", Ci.nsIXULAppInfo);
|
|
|
|
checkService("appinfo", Ci.nsIXULRuntime);
|
|
|
|
checkService("dirsvc", Ci.nsIDirectoryService);
|
|
|
|
checkService("dirsvc", Ci.nsIProperties);
|
|
|
|
checkService("prompt", Ci.nsIPromptService);
|
2010-05-29 20:30:04 -07:00
|
|
|
if ("nsIBrowserSearchService" in Ci)
|
|
|
|
checkService("search", Ci.nsIBrowserSearchService);
|
2010-03-01 18:02:09 -08:00
|
|
|
checkService("storage", Ci.mozIStorageService);
|
|
|
|
checkService("vc", Ci.nsIVersionComparator);
|
|
|
|
checkService("locale", Ci.nsILocaleService);
|
|
|
|
checkService("scriptloader", Ci.mozIJSSubScriptLoader);
|
|
|
|
checkService("ww", Ci.nsIWindowWatcher);
|
|
|
|
checkService("tm", Ci.nsIThreadManager);
|
2010-10-28 15:00:50 -07:00
|
|
|
checkService("droppedLinkHandler", Ci.nsIDroppedLinkHandler);
|
2010-04-12 07:11:37 -07:00
|
|
|
checkService("strings", Ci.nsIStringBundleService);
|
2010-07-19 16:01:23 -07:00
|
|
|
checkService("urlFormatter", Ci.nsIURLFormatter);
|
2010-10-28 15:00:50 -07:00
|
|
|
checkService("eTLD", Ci.nsIEffectiveTLDService);
|
2011-04-26 16:56:59 -07:00
|
|
|
checkService("cookies", Ci.nsICookieManager2);
|
|
|
|
checkService("logins", Ci.nsILoginManager);
|
2011-07-27 16:40:19 -07:00
|
|
|
checkService("telemetry", Ci.nsITelemetry);
|
2011-10-11 14:41:11 -07:00
|
|
|
checkService("sysinfo", Ci.nsIPropertyBag2);
|
2011-12-20 14:14:10 -08:00
|
|
|
checkService("clipboard", Ci.nsIClipboard);
|
2012-07-01 14:09:31 -07:00
|
|
|
checkService("console", Ci.nsIConsoleService);
|
|
|
|
checkService("startup", Ci.nsIAppStartup);
|
|
|
|
checkService("appShell", Ci.nsIAppShellService);
|
|
|
|
checkService("cache", Ci.nsICacheService);
|
|
|
|
checkService("scriptSecurityManager", Ci.nsIScriptSecurityManager);
|
|
|
|
checkService("domStorageManager", Ci.nsIDOMStorageManager);
|
|
|
|
checkService("DOMRequest", Ci.nsIDOMRequestService);
|
|
|
|
checkService("downloads", Ci.nsIDownloadManager);
|
|
|
|
checkService("focus", Ci.nsIFocusManager);
|
2010-01-28 10:31:45 -08:00
|
|
|
}
|