From 5c29637bef20a1680260fddaf7c47d46939de8a0 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Wed, 22 Mar 2017 17:53:52 -0400 Subject: [PATCH] Don't create a new XHR until the previous one is complete. --- tests/wpt/metadata/MANIFEST.json | 2 +- .../embedded-content/the-iframe-element/iframe_harness.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 760a3f00a0b..8075e47ca0e 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -176328,7 +176328,7 @@ "reftest" ], "html/semantics/embedded-content/the-iframe-element/iframe_harness.js": [ - "c5db7a8f3c32f79a4e24d176cb95563a999240e5", + "2f22f494c69854a79af94ccf90215ece7bb4a130", "support" ], "html/semantics/embedded-content/the-iframe-element/iframe_javascript_url_01.htm": [ diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_harness.js b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_harness.js index f4ef511d1de..2b43c54e2f2 100644 --- a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_harness.js +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_harness.js @@ -1,15 +1,16 @@ function get_test_results(id) { async_test(function(test) { - var timer = window.setInterval(test.step_func(loop), 100); + test.step_timeout(loop, 100); function loop() { var xhr = new XMLHttpRequest(); xhr.open('GET', 'stash.py?id=' + id); - xhr.onreadystatechange = test.step_func(function() { + xhr.onload = test.step_func(function() { assert_equals(xhr.status, 200); if (xhr.responseText) { assert_equals(xhr.responseText, "OK"); test.done(); - window.clearTimeout(timer); + } else { + test.step_timeout(loop, 100); } }); xhr.send();