mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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>
|
||||
parent._ping(window.location.href)
|
||||
location.reload();
|
||||
if (parent._pingCount < 5) { location.reload(); }
|
||||
</script>
|
||||
|
|
|
@ -15,18 +15,17 @@
|
|||
async_test(function(t) {
|
||||
|
||||
var url = new URL("./location_reload-iframe.html", window.location).href;
|
||||
var pingCount = 0;
|
||||
|
||||
window._pingCount = 0;
|
||||
window._ping = t.step_func(function(innerURL) {
|
||||
// Some browsers keep 'about:blank' in the session history
|
||||
if (pingCount == 0) {
|
||||
if (_pingCount == 0) {
|
||||
history_length = history.length;
|
||||
}
|
||||
assert_equals(url, innerURL, "iframe url (" + pingCount + ")");
|
||||
assert_equals(history_length, history.length, "history length (" + pingCount + ")");
|
||||
pingCount++;
|
||||
if (pingCount == 5) {
|
||||
iframe.src = 'about:blank';
|
||||
assert_equals(url, innerURL, "iframe url (" + _pingCount + ")");
|
||||
assert_equals(history_length, history.length, "history length (" + _pingCount + ")");
|
||||
_pingCount++;
|
||||
if (_pingCount == 5) {
|
||||
t.done();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue