From 36397bbd2a9665d37e2ea87a751ffdba7631319c Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Sat, 17 Oct 2009 14:37:35 +0200 Subject: [PATCH] Backout experimental changes to randomly failing sessionstore browser tests (uneffective) --- .../browser/browser_394759_privatebrowsing.js | 11 ++-- .../test/browser/browser_459906.js | 60 +++++++++---------- .../test/browser/browser_461743.js | 34 +++++------ 3 files changed, 50 insertions(+), 55 deletions(-) diff --git a/browser/components/sessionstore/test/browser/browser_394759_privatebrowsing.js b/browser/components/sessionstore/test/browser/browser_394759_privatebrowsing.js index 690c98851efc..0ec051e691ab 100644 --- a/browser/components/sessionstore/test/browser/browser_394759_privatebrowsing.js +++ b/browser/components/sessionstore/test/browser/browser_394759_privatebrowsing.js @@ -92,10 +92,9 @@ function test() { let newWin = openDialog(location, "_blank", "chrome,all,dialog=no", testURL_A); newWin.addEventListener("load", function(aEvent) { newWin.removeEventListener("load", arguments.callee, false); - info("New window has been opened"); - newWin.gBrowser.addEventListener("pageshow", function(aEvent) { - newWin.gBrowser.removeEventListener("pageshow", arguments.callee, true); - info("Content has been loaded"); + newWin.gBrowser.addEventListener("load", function(aEvent) { + newWin.gBrowser.removeEventListener("load", arguments.callee, true); + info("Window has been loaded"); executeSoon(function() { newWin.gBrowser.addTab(); executeSoon(function() { @@ -127,8 +126,8 @@ function test() { let pbWin = openDialog(location, "_blank", "chrome,all,dialog=no", testURL_B); pbWin.addEventListener("load", function(aEvent) { pbWin.removeEventListener("load", arguments.callee, false); - pbWin.gBrowser.addEventListener("pageshow", function(aEvent) { - pbWin.gBrowser.removeEventListener("pageshow", arguments.callee, true); + pbWin.gBrowser.addEventListener("load", function(aEvent) { + pbWin.gBrowser.removeEventListener("load", arguments.callee, true); executeSoon(function() { // Add another tab, though it's not strictly needed diff --git a/browser/components/sessionstore/test/browser/browser_459906.js b/browser/components/sessionstore/test/browser/browser_459906.js index be39626da591..e267263bb824 100644 --- a/browser/components/sessionstore/test/browser/browser_459906.js +++ b/browser/components/sessionstore/test/browser/browser_459906.js @@ -56,37 +56,35 @@ function test() { frameCount = 0; let tab2 = gBrowser.duplicateTab(tab); - executeSoon(function() { - tab2.linkedBrowser.addEventListener("load", function(aEvent) { - // wait for all frames to load (and reload!) completely - if (frameCount++ < 2) - return; - this.removeEventListener("load", arguments.callee, true); + tab2.linkedBrowser.addEventListener("load", function(aEvent) { + // wait for all frames to load (and reload!) completely + if (frameCount++ < 2) + return; + this.removeEventListener("load", arguments.callee, true); - let maxWait = Date.now() + 1000; - executeSoon(function() { - let iframes = tab2.linkedBrowser.contentWindow.frames; - if (iframes[1].document.body.innerHTML != uniqueValue && Date.now() < maxWait) { - executeSoon(arguments.callee); - return; - } - is(iframes[1].document.body.innerHTML, uniqueValue, - "rich textarea's content correctly duplicated"); - - let innerDomain = null; - try { - innerDomain = iframes[0].document.domain; - } - catch (ex) { /* throws for chrome: documents */ } - is(innerDomain, "localhost", "XSS exploit prevented!"); - - // clean up - gBrowser.removeTab(tab2); - gBrowser.removeTab(tab); - - finish(); - }); - }, true); - }); + let maxWait = Date.now() + 1000; + executeSoon(function() { + let iframes = tab2.linkedBrowser.contentWindow.frames; + if (iframes[1].document.body.innerHTML != uniqueValue && Date.now() < maxWait) { + executeSoon(arguments.callee); + return; + } + is(iframes[1].document.body.innerHTML, uniqueValue, + "rich textarea's content correctly duplicated"); + + let innerDomain = null; + try { + innerDomain = iframes[0].document.domain; + } + catch (ex) { /* throws for chrome: documents */ } + is(innerDomain, "localhost", "XSS exploit prevented!"); + + // clean up + gBrowser.removeTab(tab2); + gBrowser.removeTab(tab); + + finish(); + }); + }, true); }, true); } diff --git a/browser/components/sessionstore/test/browser/browser_461743.js b/browser/components/sessionstore/test/browser/browser_461743.js index ac63c65b7b45..dd877b3de90f 100644 --- a/browser/components/sessionstore/test/browser/browser_461743.js +++ b/browser/components/sessionstore/test/browser/browser_461743.js @@ -47,25 +47,23 @@ function test() { this.removeEventListener("load", arguments.callee, true); executeSoon(function() { let tab2 = gBrowser.duplicateTab(tab); - executeSoon(function() { - tab2.linkedBrowser.addEventListener("461743", function(aEvent) { - tab2.linkedBrowser.removeEventListener("461743", arguments.callee, true); - is(aEvent.data, "done", "XSS injection was attempted"); + tab2.linkedBrowser.addEventListener("461743", function(aEvent) { + tab2.linkedBrowser.removeEventListener("461743", arguments.callee, true); + is(aEvent.data, "done", "XSS injection was attempted"); + + executeSoon(function() { + let iframes = tab2.linkedBrowser.contentWindow.frames; + let innerHTML = iframes[1].document.body.innerHTML; + isnot(innerHTML, Components.utils.reportError.toString(), + "chrome access denied!"); - executeSoon(function() { - let iframes = tab2.linkedBrowser.contentWindow.frames; - let innerHTML = iframes[1].document.body.innerHTML; - isnot(innerHTML, Components.utils.reportError.toString(), - "chrome access denied!"); - - // clean up - gBrowser.removeTab(tab2); - gBrowser.removeTab(tab); - - finish(); - }); - }, true, true); - }); + // clean up + gBrowser.removeTab(tab2); + gBrowser.removeTab(tab); + + finish(); + }); + }, true, true); }); }, true); }