Updates to Bug 511096 SeaMonkey/SMILE port of FUEL Bug 458688. f=sgautherie r=Neil.
This commit is contained in:
Родитель
b9f7849e08
Коммит
a2f878d680
|
@ -14,10 +14,6 @@ var gPageLoadCount = 0;
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
waitForFocus(continue_test);
|
||||
}
|
||||
|
||||
function continue_test() {
|
||||
var windows = Application.windows;
|
||||
ok(windows, "Check access to browser windows");
|
||||
is(windows.length, 1, "There should be one browser window open");
|
||||
|
@ -55,11 +51,11 @@ function continue_test() {
|
|||
is(gPageA.uri.spec, CHROMEROOT + "ContentA.html", "Checking 'BrowserTab.uri' after opening");
|
||||
is(gPageB.uri.spec, CHROMEROOT + "ContentB.html", "Checking 'BrowserTab.uri' after opening");
|
||||
|
||||
// check event
|
||||
is(gTabOpenCount, 2, "Checking event handler for tab open");
|
||||
// check cached values from TabOpen event
|
||||
is(gPageA.uri.spec, gTabOpenPageA.uri.spec, "Checking first browser tab open is equal to page A");
|
||||
is(gPageB.uri.spec, gTabOpenPageB.uri.spec, "Checking second browser tab open is equal to page B");
|
||||
// check event
|
||||
is(gTabOpenCount, 2, "Checking event handler for tab open");
|
||||
|
||||
// test document access
|
||||
var test1 = gPageA.document.getElementById("test1");
|
||||
|
@ -76,30 +72,22 @@ function continue_test() {
|
|||
// check event
|
||||
is(gTabMoveCount, 1, "Checking event handler for tab move");
|
||||
|
||||
let browser = gBrowser.getBrowserAtIndex(gPageB.index);
|
||||
browser.addProgressListener({
|
||||
onStateChange: function(webProgress, request, stateFlags, status) {
|
||||
gBrowser.addProgressListener({
|
||||
onStateChange: function (webProgress, request, stateFlags, status) {
|
||||
info("onStateChange: " + stateFlags);
|
||||
|
||||
const complete = Ci.nsIWebProgressListener.STATE_IS_WINDOW +
|
||||
Ci.nsIWebProgressListener.STATE_IS_NETWORK +
|
||||
Ci.nsIWebProgressListener.STATE_STOP;
|
||||
if ((stateFlags & complete) == complete) {
|
||||
browser.removeProgressListener(this);
|
||||
gBrowser.removeProgressListener(this);
|
||||
onPageBLoadComplete();
|
||||
}
|
||||
},
|
||||
|
||||
onLocationChange: function() { return 0; },
|
||||
onProgressChange: function() { return 0; },
|
||||
onStatusChange: function() { return 0; },
|
||||
onSecurityChange: function() { return 0; },
|
||||
QueryInterface: function(iid) {
|
||||
if (iid.equals(Ci.nsISupportsWeakReference) ||
|
||||
iid.equals(Ci.nsIWebProgressListener) ||
|
||||
iid.equals(Ci.nsISupports))
|
||||
return this;
|
||||
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
onLocationChange: function () 0,
|
||||
onProgressChange: function () 0,
|
||||
onStatusChange: function () 0,
|
||||
onSecurityChange: function () 0
|
||||
});
|
||||
|
||||
// test loading new content with a frame into a tab
|
||||
|
@ -110,6 +98,7 @@ function continue_test() {
|
|||
|
||||
function onPageBLoadWithFrames(event) {
|
||||
gPageLoadCount++;
|
||||
info("onPageBLoadWithFrames: " + gPageLoadCount);
|
||||
}
|
||||
|
||||
function onPageBLoadComplete() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче