Skip to content

Commit

Permalink
fixup! Run iframe move test from an event handler to avoid a race con…
Browse files Browse the repository at this point in the history
…dition.
  • Loading branch information
jgraham committed Nov 21, 2014
1 parent 764c9c0 commit 1e8c94d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Expand Up @@ -10,11 +10,11 @@
var ifr = document.getElementsByTagName('iframe')[0];
ifr.contentDocument.body.appendChild(ifr.contentDocument.createElement('p')).textContent = 'Modified document';
setTimeout(function() {
document.getElementById('target').appendChild(ifr);
ifr.onload = function() {
assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
done();
};
document.getElementById('target').appendChild(ifr);
}, 100);
}
</script>
Expand Up @@ -12,11 +12,11 @@
ifr.contentDocument.write('Modified document');
ifr.contentDocument.close();
setTimeout(function() {
document.getElementById('target').appendChild(ifr);
ifr.onload = function() {
assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
done();
};
document.getElementById('target').appendChild(ifr);
}, 100);
}
</script>
Expand Up @@ -10,11 +10,11 @@
var ifr = document.getElementsByTagName('iframe')[0];
ifr.contentDocument.body.appendChild(ifr.contentDocument.createElement('p')).textContent = 'Modified document';
setTimeout(function() {
document.getElementById('target').appendChild(ifr);
ifr.onload = function() {
assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
done();
};
document.getElementById('target').appendChild(ifr);
}, 100);
}
</script>
Expand Up @@ -12,11 +12,11 @@
ifr.contentDocument.write('Modified document');
ifr.contentDocument.close();
setTimeout(function() {
document.getElementById('target').appendChild(ifr);
ifr.onload = function () {
assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
done();
};
document.getElementById('target').appendChild(ifr);
}, 100);
}
</script>

0 comments on commit 1e8c94d

Please sign in to comment.