Changed test location_reload-iframe.html to avoid infinite reloads.

This commit is contained in:
Alan Jeffrey 2016-10-25 12:57:16 -05:00
parent 21d8235a82
commit 1004d7a1f6
2 changed files with 7 additions and 8 deletions

View file

@ -1,4 +1,4 @@
<script>
parent._ping(window.location.href)
location.reload();
if (parent._pingCount < 5) { location.reload(); }
</script>

View file

@ -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();
}
});