2008-01-08 21:19:38 -08:00
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
|
|
|
// setup a phony hander to ensure the app pane will be populated.
|
|
|
|
var handler = Cc["@mozilla.org/uriloader/web-handler-app;1"].
|
|
|
|
createInstance(Ci.nsIWebHandlerApp);
|
|
|
|
handler.name = "App pane alive test";
|
|
|
|
handler.uriTemplate = "http://test.mozilla.org/%s";
|
|
|
|
|
|
|
|
var extps = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
|
|
|
|
getService(Ci.nsIExternalProtocolService);
|
|
|
|
var info = extps.getProtocolHandlerInfo("apppanetest");
|
|
|
|
info.possibleApplicationHandlers.appendElement(handler, false);
|
|
|
|
|
|
|
|
var hserv = Cc["@mozilla.org/uriloader/handler-service;1"].
|
|
|
|
getService(Ci.nsIHandlerService);
|
|
|
|
hserv.store(info);
|
|
|
|
|
|
|
|
openDialog("chrome://browser/content/preferences/preferences.xul", "Preferences",
|
|
|
|
"chrome,titlebar,toolbar,centerscreen,dialog=no", "paneApplications");
|
2008-01-12 15:06:57 -08:00
|
|
|
setTimeout(runTest, 1000);
|
2008-01-08 21:19:38 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
function runTest() {
|
|
|
|
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
|
|
|
|
getService(Ci.nsIWindowMediator);
|
|
|
|
var win = wm.getMostRecentWindow("Browser:Preferences");
|
|
|
|
ok(win, "Pref window opened");
|
|
|
|
|
|
|
|
if (win) {
|
|
|
|
var sel = win.document.documentElement.getAttribute("lastSelected");
|
|
|
|
ok(sel == "paneApplications", "Specified pane was opened");
|
|
|
|
|
|
|
|
var rbox = win.document.getElementById("handlersView");
|
|
|
|
ok(rbox, "handlersView is present");
|
|
|
|
|
|
|
|
var items = rbox && rbox.getElementsByTagName("richlistitem");
|
2008-01-12 04:28:03 -08:00
|
|
|
ok(items && items.length > 0, "App handler list populated");
|
2008-01-08 21:19:38 -08:00
|
|
|
|
|
|
|
win.close();
|
|
|
|
}
|
|
|
|
finish();
|
|
|
|
}
|