[Qt][WK1][CSS Regions] New test fast/regions/hover-on-child-parent-different-regions...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Jun 2013 12:52:49 +0000 (12:52 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Jun 2013 12:52:49 +0000 (12:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=117035

Used waitUntilDone() to ensure correct results.

Patch by Radu Stavila <stavila@adobe.com> on 2013-06-03
Reviewed by Antti Koivisto.

* fast/regions/hover-on-child-parent-different-regions-expected.txt:
* fast/regions/hover-on-child-parent-different-regions.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@151104 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/regions/hover-on-child-parent-different-regions-expected.txt
LayoutTests/fast/regions/hover-on-child-parent-different-regions.html

index 9d34e57..0420c6f 100644 (file)
@@ -1,3 +1,15 @@
+2013-06-03  Radu Stavila  <stavila@adobe.com>
+
+        [Qt][WK1][CSS Regions]  New test fast/regions/hover-on-child-parent-different-regions.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=117035
+
+        Used waitUntilDone() to ensure correct results.
+
+        Reviewed by Antti Koivisto.
+
+        * fast/regions/hover-on-child-parent-different-regions-expected.txt:
+        * fast/regions/hover-on-child-parent-different-regions.html:
+
 2013-06-03  Krzysztof Czech  <k.czech@samsung.com>
 
         [GTK][WK2] accessibility/placeholder.html is failing
index 97f1c07..66e5dd2 100644 (file)
@@ -1,11 +1,4 @@
-This test covers the case when the child is flowed into a region and the parent is flowed into a different region.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
 PASS Child hover event processed OK.
 PASS Parent hover event processed OK.
-PASS successfullyParsed is true
-
-TEST COMPLETE
 
 
index c913185..d815af7 100644 (file)
 
        <script src="../js/resources/js-test-pre.js"></script>
 </head>
-<body>
-       <p class="visibleElement">This test covers the case when the <span style="color: orange;"><b>child</b></span> is flowed into a <span style="color: blue;"><b>region</b></span> and the <span style="color: darkred;"><b>parent</b></span> is flowed into a different <span style="color: green;"><b>region</b></span>.</p>
-       <ol class="visibleElement">
-               <li>Move the mouse inside the orange square</li>
-               <li>The orange square should turn yellow and the big darkred square should turn green</li>
-       </ol>
-       <div class="bigBox" id="parent">
-               <div class="smallBox" id="child"></div>
-       </div>
-       
-       <div class="hugeBox" id="regionParent"></div>
-       <div class="bigBox" id="regionChild"></div>
-       
-       <script type="text/javascript">
+
+<script type="text/javascript">
+       if (!window.testRunner) {
                description("This test covers the case when the child is flowed into a region and the parent is flowed into a different region.")
 
+               var elementsToHide = document.querySelectorAll("#console, #description");
+               for (var i=0; i<elementsToHide.length; i++)
+                       elementsToHide[i].style.visibility = "hidden";
+       }
+
+       if (window.testRunner)
+               testRunner.waitUntilDone();
+
+       function beginTest() {
                if (window.eventSender) {
                        var child  = document.querySelector("#child");
                        var parent = document.querySelector("#parent");
                        // move mouse on the child object
                        eventSender.mouseMoveTo(child.offsetLeft + 50, child.offsetTop + 50);
                        eventSender.mouseDown(0);
-                       eventSender.leapForward(500);
-                       eventSender.mouseUp(0);
 
-                       var childColor = window.getComputedStyle(child).getPropertyValue("background-color");
-            var parentColor = window.getComputedStyle(parent).getPropertyValue("background-color");
+                       setTimeout(release, 0);                 
+               }
+       }
 
-                       if (childColor == "rgb(255, 255, 0)")
-                               testPassed("Child hover event processed OK.");
-                       else
-                               testFailed("Child hover event FAILED to process.");
+       function release() {
+               var child  = document.querySelector("#child");
+               var parent = document.querySelector("#parent");
 
-                       if (parentColor == "rgb(0, 128, 0)")
-                               testPassed("Parent hover event processed OK.");
-                       else
-                               testFailed("Parent hover event FAILED to process.");
-               }
+               var childColor = window.getComputedStyle(child).getPropertyValue("background-color");
+        var parentColor = window.getComputedStyle(parent).getPropertyValue("background-color");
 
-               if (window.testRunner) {
-                       var elementsToHide = document.querySelectorAll(".visibleElement, .tinyBox, .smallBox, .bigBox, .hugeBox");
-                       for (var i=0; i<elementsToHide.length; i++)
-                               elementsToHide[i].style.visibility = "hidden";
-               }
+               if (childColor == "rgb(255, 255, 0)")
+                       testPassed("Child hover event processed OK.");
+               else
+                       testFailed("Child hover event FAILED to process.");
 
-               else {
-                       var elementsToHide = document.querySelectorAll("#console, #description");
-                       for (var i=0; i<elementsToHide.length; i++)
-                               elementsToHide[i].style.visibility = "hidden";
-               }
-       </script>
+               if (parentColor == "rgb(0, 128, 0)")
+                       testPassed("Parent hover event processed OK.");
+               else
+                       testFailed("Parent hover event FAILED to process.");
+
+               var elementsToHide = document.querySelectorAll(".visibleElement, .tinyBox, .smallBox, .bigBox, .hugeBox");
+               for (var i=0; i<elementsToHide.length; i++)
+                       elementsToHide[i].style.visibility = "hidden";
+
+               if (window.eventSender)
+               eventSender.mouseUp(0);
+       if (window.testRunner)
+                       setTimeout("testRunner.notifyDone()", 0);
+       }
+
+</script>
+
+<body onload="beginTest()">
+       <p class="visibleElement">This test covers the case when the <span style="color: orange;"><b>child</b></span> is flowed into a <span style="color: blue;"><b>region</b></span> and the <span style="color: darkred;"><b>parent</b></span> is flowed into a different <span style="color: green;"><b>region</b></span>.</p>
+       <ol class="visibleElement">
+               <li>Move the mouse inside the orange square</li>
+               <li>The orange square should turn yellow and the big darkred square should turn green</li>
+       </ol>
+       <div class="bigBox" id="parent">
+               <div class="smallBox" id="child"></div>
+       </div>
+       
+       <div class="hugeBox" id="regionParent"></div>
+       <div class="bigBox" id="regionChild"></div>
 
-       <script src="../js/resources/js-test-post.js"></script>
+       <div 
 </body>
 </html>
\ No newline at end of file