mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 487402 - test_dynUnsecureRedirect.html intermittently fails, change timeouts to callbacks where possible, r=kaie, a=test only change/orange fix
This commit is contained in:
parent
860a0298a2
commit
8bb7670f7e
@ -208,3 +208,16 @@ function isSecurityState(expectedState, message, test)
|
||||
throw "Invalid isSecurityState state";
|
||||
}
|
||||
}
|
||||
|
||||
function waitForSecurityState(expectedState, callback)
|
||||
{
|
||||
var roundsLeft = 200; // Wait for 20 seconds (=200*100ms)
|
||||
var interval =
|
||||
window.setInterval(function() {
|
||||
isSecurityState(expectedState, "", function(isok) {if (isok) {roundsLeft = 0;}});
|
||||
if (!roundsLeft--) {
|
||||
window.clearInterval(interval);
|
||||
callback();
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
@ -15,10 +15,11 @@
|
||||
document.getElementById("para").style.content =
|
||||
"url('http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg')";
|
||||
|
||||
window.setTimeout(function() {
|
||||
waitForSecurityState("broken", function()
|
||||
{
|
||||
isSecurityState("broken", "insecure content added by styling breaks security");
|
||||
finish();
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
function afterNavigationTest()
|
||||
|
@ -18,10 +18,11 @@
|
||||
"http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg";
|
||||
}, 0);
|
||||
|
||||
window.setTimeout(function() {
|
||||
waitForSecurityState("broken", function()
|
||||
{
|
||||
isSecurityState("broken", "src='http://...' changed to broken");
|
||||
finish();
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
function afterNavigationTest()
|
||||
|
@ -17,10 +17,11 @@
|
||||
document.body.background =
|
||||
"http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg";
|
||||
|
||||
window.setTimeout(function() {
|
||||
waitForSecurityState("broken", function()
|
||||
{
|
||||
isSecurityState("broken", "document.body.background='http://...' changed to broken");
|
||||
finish();
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
function afterNavigationTest()
|
||||
|
@ -19,11 +19,11 @@
|
||||
"<img id='image1' src='http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg' />";
|
||||
}, 1);
|
||||
|
||||
window.setTimeout(function()
|
||||
waitForSecurityState("broken", function()
|
||||
{
|
||||
isSecurityState("broken", "innerHTML loading insecure changed to broken");
|
||||
finish();
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
function afterNavigationTest()
|
||||
|
Loading…
Reference in New Issue
Block a user