mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 22:25:30 +00:00
Backout experimental changes to randomly failing sessionstore browser tests (uneffective)
This commit is contained in:
parent
39d97011a4
commit
36397bbd2a
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user