Jacek Caban : mshtml/tests: Use winetest.js helpers in asyncscriptload.js.
Alexandre Julliard
julliard at winehq.org
Thu Mar 25 16:49:23 CDT 2021
Module: wine
Branch: master
Commit: da30fa03574816cbd69c636ab39452ee9fe2882f
URL: https://source.winehq.org/git/wine.git/?a=commit;h=da30fa03574816cbd69c636ab39452ee9fe2882f
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Mar 25 19:28:04 2021 +0100
mshtml/tests: Use winetest.js helpers in asyncscriptload.js.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mshtml/tests/asyncscriptload.js | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/dlls/mshtml/tests/asyncscriptload.js b/dlls/mshtml/tests/asyncscriptload.js
index a73e5e849e8..6dc333afdf4 100644
--- a/dlls/mshtml/tests/asyncscriptload.js
+++ b/dlls/mshtml/tests/asyncscriptload.js
@@ -16,6 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+var tests = [];
var head = document.getElementsByTagName("head")[0];
/* Dynamically created script element is downloaded as soon as src property is set,
@@ -24,7 +25,7 @@ var detached_elem_executed = false;
var detached_elem = document.createElement("script");
detached_elem.src = "jsstream.php?detached_script";
-function test_detached_script_elem() {
+async_test("detached_script_elem", function() {
var oncomplete_called = false;
detached_elem.onreadystatechange = guard(function() {
if(detached_elem.readyState == "complete") {
@@ -44,7 +45,7 @@ function test_detached_script_elem() {
});
external.writeStream("detached_script", 'detached_elem_executed = true;');
-}
+});
/* Dynamically created script elements are evaluated as soon as they are loaded, no matter
* how they are ordered in the tree. */
@@ -58,7 +59,7 @@ var attached_elem2 = document.createElement("script");
attached_elem2.src = "jsstream.php?attached_script2";
head.appendChild(attached_elem2);
-function test_attached_script_elem() {
+async_test("attached_script_elem", function() {
attached_elem1.onreadystatechange = guard(function() {
ok(attached_elem1.readyState == "loaded", "attached_elem1.readyState = " + attached_elem2.readyState);
ok(attached_elem1_executed, "attached element 1 not executed before readyState complete");
@@ -73,9 +74,9 @@ function test_attached_script_elem() {
});
external.writeStream("attached_script2", 'attached_elem2_executed = true;');
-}
+});
-function test_dynamic_element() {
+async_test("append_script", function() {
var elem = document.createElement("script");
var ready_states = "";
@@ -88,10 +89,4 @@ function test_dynamic_element() {
document.body.appendChild(elem);
elem.src = "jsstream.php?simple";
external.writeStream("simple", " ");
-}
-
-var tests = [
- test_detached_script_elem,
- test_attached_script_elem,
- test_dynamic_element
-];
+});
More information about the wine-cvs
mailing list