зеркало из https://github.com/mozilla/gecko-dev.git
Backout experimental changes to randomly failing sessionstore browser tests (uneffective)
This commit is contained in:
Родитель
39d97011a4
Коммит
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)
|
||||
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;
|
||||
this.removeEventListener("load", arguments.callee, true);
|
||||
}
|
||||
is(iframes[1].document.body.innerHTML, uniqueValue,
|
||||
"rich textarea's content correctly duplicated");
|
||||
|
||||
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!");
|
||||
|
||||
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);
|
||||
|
||||
// clean up
|
||||
gBrowser.removeTab(tab2);
|
||||
gBrowser.removeTab(tab);
|
||||
|
||||
finish();
|
||||
});
|
||||
}, true);
|
||||
});
|
||||
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);
|
||||
// clean up
|
||||
gBrowser.removeTab(tab2);
|
||||
gBrowser.removeTab(tab);
|
||||
|
||||
finish();
|
||||
});
|
||||
}, true, true);
|
||||
});
|
||||
finish();
|
||||
});
|
||||
}, true, true);
|
||||
});
|
||||
}, true);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче