2009-07-02 10:52:42 -07:00
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
2010-09-15 23:09:27 -07:00
|
|
|
var pageInfo;
|
2009-10-16 23:14:22 -07:00
|
|
|
gBrowser.selectedTab = gBrowser.addTab();
|
|
|
|
gBrowser.selectedBrowser.addEventListener("load", function () {
|
|
|
|
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
|
|
|
pageInfo = BrowserPageInfo();
|
2010-04-02 00:20:42 -07:00
|
|
|
Services.obs.addObserver(observer, "page-info-dialog-loaded", false);
|
2009-10-16 23:14:22 -07:00
|
|
|
}, true);
|
2009-07-02 10:52:42 -07:00
|
|
|
content.location =
|
|
|
|
"https://example.com/browser/browser/base/content/test/feed_tab.html";
|
|
|
|
|
2010-02-06 00:47:42 -08:00
|
|
|
function observer(win, topic, data) {
|
|
|
|
if (topic != "page-info-dialog-loaded")
|
|
|
|
return;
|
2009-07-02 10:52:42 -07:00
|
|
|
|
2010-09-15 23:09:27 -07:00
|
|
|
handlePageInfo();
|
2009-07-02 10:52:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function $(aId) { return pageInfo.document.getElementById(aId) };
|
|
|
|
|
|
|
|
function handlePageInfo() {
|
|
|
|
var feedTab = $("feedTab");
|
|
|
|
var feedListbox = $("feedListbox");
|
|
|
|
|
|
|
|
ok(feedListbox, "Feed list is null (feeds tab is broken)");
|
|
|
|
|
|
|
|
var feedRowsNum = feedListbox.getRowCount();
|
|
|
|
|
|
|
|
ok(feedRowsNum == 3, "Number of feeds listed: " +
|
|
|
|
feedRowsNum + ", should be 3");
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < feedRowsNum; i++) {
|
|
|
|
let feedItem = feedListbox.getItemAtIndex(i);
|
|
|
|
ok(feedItem.getAttribute("name") == (i+1),
|
|
|
|
"Name given: " + feedItem.getAttribute("name") + ", should be " + (i+1));
|
|
|
|
}
|
|
|
|
|
|
|
|
pageInfo.close();
|
|
|
|
gBrowser.removeCurrentTab();
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
}
|