browser_bug521216.js
Go to the documentation of this file.
1 var expected = ["TabOpen", "onLocationChange", "onStateChange", "onLinkIconAvailable"];
2 var actual = [];
3 var tabIndex = -1;
4 __defineGetter__("tab", function () gBrowser.tabContainer.childNodes[tabIndex]);
5 
6 function test() {
8  tabIndex = gBrowser.tabContainer.childElementCount;
9  gBrowser.addTabsProgressListener(progressListener);
10  gBrowser.tabContainer.addEventListener("TabOpen", TabOpen, false);
11  gBrowser.addTab("data:text/html,<html><head><link href='about:logo' rel='shortcut icon'>");
12 }
13 
14 function record(aName) {
15  info("got " + aName);
16  if (actual.indexOf(aName) == -1)
17  actual.push(aName);
18  if (actual.length == expected.length) {
19  is(actual.toString(), expected.toString(),
20  "got events and progress notifications in expected order");
21  gBrowser.removeTab(tab);
22  gBrowser.removeTabsProgressListener(progressListener);
23  gBrowser.tabContainer.removeEventListener("TabOpen", TabOpen, false);
24  finish();
25  }
26 }
27 
28 function TabOpen(aEvent) {
29  if (aEvent.target == tab)
30  record(arguments.callee.name);
31 }
32 
34  onLocationChange: function onLocationChange(aBrowser) {
35  if (aBrowser == tab.linkedBrowser)
36  record(arguments.callee.name);
37  },
38  onProgressChange: function () {},
39  onSecurityChange: function () {},
41  if (aBrowser == tab.linkedBrowser)
42  record(arguments.callee.name);
43  },
44  onStatusChange: function () {},
45  onLinkIconAvailable: function onLinkIconAvailable(aBrowser) {
46  if (aBrowser == tab.linkedBrowser)
47  record(arguments.callee.name);
48  }
49 };
var tab
function test()
var progressListener
function record(aName)
waitForExplicitFinish()
__defineGetter__("tab", function() gBrowser.tabContainer.childNodes[tabIndex])
var expected
return!aWindow arguments!aWindow arguments[0]
_updateCookies aName
_updateTextAndScrollDataForTab aBrowser
ContinuingWebProgressListener prototype onStateChange
var tabIndex
function TabOpen(aEvent)
var actual