Reviewed by Adam Treat.
[WebKit-https.git] / LayoutTests / wml / resources / WMLTestCase.js
index 926f183..845bbba 100644 (file)
@@ -42,7 +42,7 @@ function createWMLTestCase(desc, substituteVariables, testName) {
 
         // External deck jumps
         if (testDocument != null && !substituteVariables) {
-            executeTest();
+            delayExecuteTest();
             return;
         }
 
@@ -51,7 +51,7 @@ function createWMLTestCase(desc, substituteVariables, testName) {
 
         // Variable refresh
         if (loaded && substituteVariables) {
-            executeTest();
+            delayExecuteTest();
             return;
         }
 
@@ -61,7 +61,7 @@ function createWMLTestCase(desc, substituteVariables, testName) {
         // Internal deck jumps
         if (!substituteVariables) {
             executed = true;
-            executeTest();
+            delayExecuteTest();
         }
     }
 
@@ -90,6 +90,11 @@ function startTest(x, y) {
     window.setTimeout("triggerUpdate(" + x + ", " + y + ")", 0);
 }
 
+function delayExecuteTest() {
+    // Assure first layout finished, after making changes
+    window.setTimeout("executeTest()", 0);
+}
+
 function completeTest() {
     var script = document.createElementNS(xhtmlNS, "script");