mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #11053 - yodalee:Use-onload-in-iframe-test, r=mbrubeck
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. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11053) <!-- Reviewable:end -->
This commit is contained in:
commit
76abd9d7c1
1 changed files with 2 additions and 10 deletions
|
@ -9,19 +9,11 @@
|
||||||
<iframe src="resources/iframe_contentDocument_inner.html" id="iframe"></iframe>
|
<iframe src="resources/iframe_contentDocument_inner.html" id="iframe"></iframe>
|
||||||
<script>
|
<script>
|
||||||
async_test(function() {
|
async_test(function() {
|
||||||
var timeout = 100;
|
|
||||||
var iframe = document.getElementById('iframe');
|
var iframe = document.getElementById('iframe');
|
||||||
function test_contentWindow() {
|
iframe.onload = this.step_func_done(function() {
|
||||||
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;
|
|
||||||
}
|
|
||||||
assert_equals(iframe.contentDocument.getElementById('test').textContent, 'value');
|
assert_equals(iframe.contentDocument.getElementById('test').textContent, 'value');
|
||||||
this.done();
|
this.done();
|
||||||
}
|
})
|
||||||
this.step(test_contentWindow);
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue