55 const XULAPPINFO_CID = Components.ID(
"{c763b610-9d49-455a-bbd2-ede71682a1ac}");
58 const XULRUNTIME_CID = Components.ID(
"{b96e56dc-1dd1-11b2-91a1-96a45c3e4adf}");
61 var
gRDF = Components.classes[
"@mozilla.org/rdf/rdf-service;1"]
62 .getService(Components.interfaces.nsIRDFService);
76 return gRDF.GetResource(
EM_NS(property));
80 return gRDF.GetLiteral(
literal);
84 return gRDF.GetIntLiteral(integer);
88 return gRDF.GetDateLiteral(integer);
99 if (literalOrResource instanceof Components.interfaces.nsIRDFLiteral)
100 return literalOrResource.Value;
101 if (literalOrResource instanceof Components.interfaces.nsIRDFResource)
102 return literalOrResource.Value;
113 if (
literal instanceof Components.interfaces.nsIRDFInt)
153 lf.append(
name +
".xpi");
155 do_throw(
"Addon "+
name+
" does not exist.");
178 appBuildID:
"2007010101",
179 platformVersion: platformVersion,
180 platformBuildID:
"2007010101",
182 logConsoleErrors:
true,
184 XPCOMABI:
"noarch-spidermonkey",
187 if (iid.equals(Components.interfaces.nsIXULAppInfo)
188 || iid.equals(Components.interfaces.nsIXULRuntime)
189 || iid.equals(Components.interfaces.nsISupports))
192 throw Components.results.NS_ERROR_NO_INTERFACE;
199 throw Components.results.NS_ERROR_NO_AGGREGATION;
200 return XULAppInfo.QueryInterface(iid);
203 var
registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
217 var updateSvc = Components.classes[
"@mozilla.org/updates/update-service;1"]
218 .getService(Components.interfaces.nsISupports);
220 gEM = Components.classes[
"@mozilla.org/extensions/manager;1"]
221 .getService(Components.interfaces.nsIExtensionManager);
223 gEM.QueryInterface(Components.interfaces.nsIObserver);
224 gEM.observe(
null,
"app-startup",
null);
225 gEM.observe(
null,
"profile-after-change",
"startup");
227 var needsRestart =
false;
229 needsRestart = gEM.checkForMismatches();
232 needsRestart = gEM.start(
null);
239 var dummy = gEM.datasource;
260 var extensions =
gProfD.clone();
261 extensions.append(
"extensions");
262 if (extensions.exists()) {
263 var ioServ = Components.classes[
"@mozilla.org/network/io-service;1"]
264 .getService(Components.interfaces.nsIIOService);
265 var addons = extensions.directoryEntries;
266 while (addons.hasMoreElements()) {
267 var addon = addons.getNext().QueryInterface(Components.interfaces.nsIFile);
268 if (addon.isDirectory() && addon.leafName !=
"staged-xpis") {
269 addon.append(
"install.rdf");
270 if (addon.exists()) {
271 var ds = gRDF.GetDataSource(ioServ.newFileURI(addon).spec);
272 gRDF.UnregisterDataSource(ds);
278 var needsRestart = gEM.start(
null);
283 var
gDirSvc = Components.classes[
"@mozilla.org/file/directory_service;1"]
284 .getService(Components.interfaces.nsIProperties);
285 var
gTestRoot = gDirSvc.get(
"CurProcD", Components.interfaces.nsILocalFile);
286 gTestRoot = gTestRoot.parent.parent;
287 gTestRoot.append(
"_tests");
288 gTestRoot.append(
"xpcshell-simple");
289 gTestRoot.append(
"test_extensionmanager");
293 gProfD.append(
"profile");
296 gProfD.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
299 getFile:
function(prop, persistent) {
300 persistent.value =
true;
303 return gProfD.clone();
307 if (iid.equals(Components.interfaces.nsIDirectoryServiceProvider) ||
308 iid.equals(Components.interfaces.nsISupports)) {
311 throw Components.results.NS_ERROR_NO_INTERFACE;
314 gDirSvc.QueryInterface(Components.interfaces.nsIDirectoryService)
315 .registerProvider(dirProvider);
317 var
gPrefs = Components.classes[
"@mozilla.org/preferences;1"]
318 .getService(Components.interfaces.nsIPrefBranch);
320 gPrefs.setBoolPref(
"extensions.logging.enabled",
true);
function getFile(fileName)