mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Experimental changes to randomly failing sessionstore browser tests (will backout if noting changes)
This commit is contained in:
parent
c1e6d79e3b
commit
d7d35e3dac
@ -92,9 +92,10 @@ function test() {
|
||||
let newWin = openDialog(location, "_blank", "chrome,all,dialog=no", testURL_A);
|
||||
newWin.addEventListener("load", function(aEvent) {
|
||||
newWin.removeEventListener("load", arguments.callee, false);
|
||||
newWin.gBrowser.addEventListener("load", function(aEvent) {
|
||||
newWin.gBrowser.removeEventListener("load", arguments.callee, true);
|
||||
info("Window has been loaded");
|
||||
info("New window has been opened");
|
||||
newWin.gBrowser.addEventListener("pageshow", function(aEvent) {
|
||||
newWin.gBrowser.removeEventListener("pageshow", arguments.callee, true);
|
||||
info("Content has been loaded");
|
||||
executeSoon(function() {
|
||||
newWin.gBrowser.addTab();
|
||||
executeSoon(function() {
|
||||
@ -126,8 +127,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("load", function(aEvent) {
|
||||
pbWin.gBrowser.removeEventListener("load", arguments.callee, true);
|
||||
pbWin.gBrowser.addEventListener("pageshow", function(aEvent) {
|
||||
pbWin.gBrowser.removeEventListener("pageshow", arguments.callee, true);
|
||||
|
||||
executeSoon(function() {
|
||||
// Add another tab, though it's not strictly needed
|
||||
|
@ -56,35 +56,37 @@ function test() {
|
||||
|
||||
frameCount = 0;
|
||||
let tab2 = gBrowser.duplicateTab(tab);
|
||||
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);
|
||||
executeSoon(function() {
|
||||
tab2.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||
// wait for all frames to load (and reload!) completely
|
||||
if (frameCount++ < 2)
|
||||
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);
|
||||
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);
|
||||
});
|
||||
}, true);
|
||||
}
|
||||
|
@ -47,23 +47,25 @@ function test() {
|
||||
this.removeEventListener("load", arguments.callee, true);
|
||||
executeSoon(function() {
|
||||
let tab2 = gBrowser.duplicateTab(tab);
|
||||
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() {
|
||||
tab2.linkedBrowser.addEventListener("461743", function(aEvent) {
|
||||
tab2.linkedBrowser.removeEventListener("461743", arguments.callee, true);
|
||||
is(aEvent.data, "done", "XSS injection was attempted");
|
||||
|
||||
// clean up
|
||||
gBrowser.removeTab(tab2);
|
||||
gBrowser.removeTab(tab);
|
||||
|
||||
finish();
|
||||
});
|
||||
}, true, true);
|
||||
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);
|
||||
});
|
||||
});
|
||||
}, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user