aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryodalee <lc85301@gmail.com>2016-05-06 22:54:22 +0800
committeryodalee <lc85301@gmail.com>2016-05-06 22:54:22 +0800
commitb8ccbc57f3167cbf9b9850ccbe8dd01ff7316637 (patch)
treec9af0f017758763a51d105703c81d60de18210a4
parent6c326cd3726d744474fed3436c9d6885c2b2c6a5 (diff)
downloadservo-b8ccbc57f3167cbf9b9850ccbe8dd01ff7316637.tar.gz
servo-b8ccbc57f3167cbf9b9850ccbe8dd01ff7316637.zip
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.
-rw-r--r--tests/wpt/mozilla/tests/mozilla/iframe_contentDocument.html12
1 files changed, 2 insertions, 10 deletions
diff --git a/tests/wpt/mozilla/tests/mozilla/iframe_contentDocument.html b/tests/wpt/mozilla/tests/mozilla/iframe_contentDocument.html
index 28dd011d2cf..dcbb389fdd6 100644
--- a/tests/wpt/mozilla/tests/mozilla/iframe_contentDocument.html
+++ b/tests/wpt/mozilla/tests/mozilla/iframe_contentDocument.html
@@ -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>