4 var pageInfo, obs, atTest = 0;
7 gTestPage.linkedBrowser.addEventListener(
"load", handleLoad,
true);
9 "https://example.com/browser/browser/base/content/test/feed_tab.html";
14 if (topic !=
"page-info-dialog-loaded")
29 obs.removeObserver(observer,
"page-info-dialog-loaded");
30 testLockDoubleClick();
36 function handleLoad() {
39 obs = Components.classes[
"@mozilla.org/observer-service;1"]
40 .getService(Components.interfaces.nsIObserverService);
41 obs.addObserver(observer,
"page-info-dialog-loaded",
false);
44 function $(aId) {
return pageInfo.document.getElementById(aId) };
46 function handlePageInfo() {
47 var feedTab = $(
"feedTab");
48 var feedListbox = $(
"feedListbox");
50 ok(feedListbox,
"Feed list is null (feeds tab is broken)");
52 var feedRowsNum = feedListbox.getRowCount();
54 ok(feedRowsNum == 3,
"Number of feeds listed: " +
55 feedRowsNum +
", should be 3");
58 for (var
i = 0;
i < feedRowsNum;
i++) {
59 let feedItem = feedListbox.getItemAtIndex(
i);
60 ok(feedItem.getAttribute(
"name") == (
i+1),
61 "Name given: " + feedItem.getAttribute(
"name") +
", should be " + (
i+1));
64 pageInfo.addEventListener(
"unload",
function() {
65 pageInfo.removeEventListener(
"unload",
arguments.callee,
false);
66 var lockIcon = document.getElementById(
"security-button");
67 EventUtils.synthesizeMouse(lockIcon, 0, 0, {clickCount: 1});
72 function testLockClick() {
73 var deck = $(
"mainDeck");
74 is(deck.selectedPanel.id,
"securityPanel",
"The security tab should open when the lock icon is clicked");
75 pageInfo.addEventListener(
"unload",
function() {
76 pageInfo.removeEventListener(
"unload",
arguments.callee,
false);
77 var lockIcon = document.getElementById(
"security-button");
78 EventUtils.synthesizeMouse(lockIcon, 0, 0, {clickCount: 1});
79 EventUtils.synthesizeMouse(lockIcon, 0, 0, {clickCount: 2});
84 function testLockDoubleClick() {
85 var pageInfoDialogs = Components.classes[
"@mozilla.org/appshell/window-mediator;1"]
86 .getService(Components.interfaces.nsIWindowMediator)
87 .getEnumerator(
"Browser:page-info");
89 while(pageInfoDialogs.hasMoreElements()) {
91 pageInfo = pageInfoDialogs.getNext();
94 is(i, 1,
"When the lock is clicked twice there should be only one page info dialog");
96 gBrowser.removeCurrentTab();
function BrowserPageInfo(doc, initialTab, imageElement)
return!aWindow arguments!aWindow arguments[0]
_getSelectedPageStyle s i
sbDeviceFirmwareAutoCheckForUpdate prototype observe