Skip to content

Commit

Permalink
use onload in iframe test
Browse files Browse the repository at this point in the history
the iframe test is implemented using setTimeout function
Since the iframe already implement load event, replacing
timeout function with load event.
  • Loading branch information
yodalee committed May 6, 2016
1 parent 6c326cd commit b8ccbc5
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tests/wpt/mozilla/tests/mozilla/iframe_contentDocument.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,11 @@
<iframe src="resources/iframe_contentDocument_inner.html" id="iframe"></iframe>
<script>
async_test(function() {
var timeout = 100;
var iframe = document.getElementById('iframe');
function test_contentWindow() {
if (!iframe.contentWindow) {
// Iframe not loaded yet, try again.
// No load event for iframe, insert bug number here.
setTimeout(this.step_func(test_contentWindow), timeout);
return;
}
iframe.onload = this.step_func_done(function() {
assert_equals(iframe.contentDocument.getElementById('test').textContent, 'value');
this.done();
}
this.step(test_contentWindow);
})
});
</script>
</body>
Expand Down

0 comments on commit b8ccbc5

Please sign in to comment.