1 const Ci = Components.interfaces;
4 Ci.nsIWebProgressListener.STATE_IS_NETWORK;
7 onProgressChange:
function (aWebProgress, aRequest,
8 aCurSelfProgress, aMaxSelfProgress,
9 aCurTotalProgress, aMaxTotalProgress) {
12 onStateChange:
function (aWebProgress, aRequest, aStateFlags, aStatus) {
13 var state =
"onStateChange";
14 info(
"FrontProgress: " + state +
" 0x" + aStateFlags.toString(16));
15 ok(
gFrontNotificationsPos < gFrontNotifications.length,
"Got an expected notification for the front notifications listener");
16 is(state, gFrontNotifications[
gFrontNotificationsPos],
"Got a notification for the front notifications listener");
17 gFrontNotificationsPos++;
20 onLocationChange:
function (aWebProgress, aRequest, aLocationURI) {
21 var state =
"onLocationChange";
22 info(
"FrontProgress: " + state +
" " + aLocationURI.spec);
23 ok(
gFrontNotificationsPos < gFrontNotifications.length,
"Got an expected notification for the front notifications listener");
24 is(state, gFrontNotifications[
gFrontNotificationsPos],
"Got a notification for the front notifications listener");
25 gFrontNotificationsPos++;
28 onStatusChange:
function (aWebProgress, aRequest, aStatus, aMessage) {
31 onSecurityChange:
function (aWebProgress, aRequest,
aState) {
32 var state =
"onSecurityChange";
33 info(
"FrontProgress: " + state +
" 0x" +
aState.toString(16));
34 ok(
gFrontNotificationsPos < gFrontNotifications.length,
"Got an expected notification for the front notifications listener");
35 is(state, gFrontNotifications[
gFrontNotificationsPos],
"Got a notification for the front notifications listener");
36 gFrontNotificationsPos++;
40 var gAllProgressListener = {
41 onProgressChange:
function (
aBrowser, aWebProgress, aRequest,
42 aCurSelfProgress, aMaxSelfProgress,
43 aCurTotalProgress, aMaxTotalProgress) {
47 var state =
"onStateChange";
48 info(
"AllProgress: " + state +
" 0x" + aStateFlags.toString(16));
61 onLocationChange:
function (
aBrowser, aWebProgress, aRequest, aLocationURI) {
62 var state =
"onLocationChange";
63 info(
"AllProgress: " + state +
" " + aLocationURI.spec);
70 onStatusChange:
function (
aBrowser, aWebProgress, aRequest, aStatus, aMessage) {
71 var state =
"onStatusChange";
75 onSecurityChange:
function (
aBrowser, aWebProgress, aRequest,
aState) {
76 var state =
"onSecurityChange";
77 info(
"AllProgress: " + state +
" 0x" +
aState.toString(16));
87 var
gTestPage =
"/browser/browser/base/content/test/alltabslistener.html";
93 gBackgroundTab = gBrowser.addTab(
"about:blank");
94 gForegroundTab = gBrowser.addTab(
"about:blank");
95 gBackgroundBrowser = gBrowser.getBrowserForTab(gBackgroundTab);
96 gForegroundBrowser = gBrowser.getBrowserForTab(gForegroundTab);
101 gForegroundBrowser.addEventListener(
"load",
startTests,
true);
105 gFrontNotificationsPos = 0;
106 gAllNotificationsPos = 0;
113 gForegroundBrowser.removeEventListener(
"load",
startTests,
true);
120 gBrowser.addTabsProgressListener(gAllProgressListener);
122 gAllNotifications = [
134 gAllNotifications = [
147 gAllNotifications = [
153 gFrontNotifications = [];
159 gAllNotifications = [
166 gFrontNotifications = [];
180 gAllNotifications = [
192 gAllNotifications = [
198 gFrontNotifications = [];
204 gBrowser.removeTabsProgressListener(gAllProgressListener);
205 gBrowser.removeTab(gBackgroundTab);
206 gBrowser.removeTab(gForegroundTab);
function runTest(browser, url, next)
var gFrontProgressListener
_updateTextAndScrollDataForTab aBrowser
ContinuingWebProgressListener prototype onStateChange
var gFrontNotificationsPos