mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Changed test location_reload-iframe.html to avoid infinite reloads.
This commit is contained in:
parent
21d8235a82
commit
1004d7a1f6
2 changed files with 7 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
||||||
<script>
|
<script>
|
||||||
parent._ping(window.location.href)
|
parent._ping(window.location.href)
|
||||||
location.reload();
|
if (parent._pingCount < 5) { location.reload(); }
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -15,18 +15,17 @@
|
||||||
async_test(function(t) {
|
async_test(function(t) {
|
||||||
|
|
||||||
var url = new URL("./location_reload-iframe.html", window.location).href;
|
var url = new URL("./location_reload-iframe.html", window.location).href;
|
||||||
var pingCount = 0;
|
|
||||||
|
|
||||||
|
window._pingCount = 0;
|
||||||
window._ping = t.step_func(function(innerURL) {
|
window._ping = t.step_func(function(innerURL) {
|
||||||
// Some browsers keep 'about:blank' in the session history
|
// Some browsers keep 'about:blank' in the session history
|
||||||
if (pingCount == 0) {
|
if (_pingCount == 0) {
|
||||||
history_length = history.length;
|
history_length = history.length;
|
||||||
}
|
}
|
||||||
assert_equals(url, innerURL, "iframe url (" + pingCount + ")");
|
assert_equals(url, innerURL, "iframe url (" + _pingCount + ")");
|
||||||
assert_equals(history_length, history.length, "history length (" + pingCount + ")");
|
assert_equals(history_length, history.length, "history length (" + _pingCount + ")");
|
||||||
pingCount++;
|
_pingCount++;
|
||||||
if (pingCount == 5) {
|
if (_pingCount == 5) {
|
||||||
iframe.src = 'about:blank';
|
|
||||||
t.done();
|
t.done();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue