use onload in iframe test

the iframe test is implemented using setTimeout function
Since the iframe already implement load event, replacing
timeout function with load event.
This commit is contained in:
yodalee 2016-05-06 22:54:22 +08:00
parent 6c326cd372
commit b8ccbc57f3

View file

@ -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>