Title: [128270] trunk/LayoutTests
Revision
128270
Author
joc...@chromium.org
Date
2012-09-12 00:29:52 -0700 (Wed, 12 Sep 2012)

Log Message

Change fast/events/popup-blocking-timers.html to generate a user action for each popup
https://bugs.webkit.org/show_bug.cgi?id=96475

Reviewed by Adam Barth.

The chromium port only allows one user gesture gated action per user
gesture.

* fast/events/popup-blocking-timers-expected.txt:
* fast/events/popup-blocking-timers.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (128269 => 128270)


--- trunk/LayoutTests/ChangeLog	2012-09-12 07:02:02 UTC (rev 128269)
+++ trunk/LayoutTests/ChangeLog	2012-09-12 07:29:52 UTC (rev 128270)
@@ -1,3 +1,16 @@
+2012-09-12  Jochen Eisinger  <joc...@chromium.org>
+
+        Change fast/events/popup-blocking-timers.html to generate a user action for each popup
+        https://bugs.webkit.org/show_bug.cgi?id=96475
+
+        Reviewed by Adam Barth.
+
+        The chromium port only allows one user gesture gated action per user
+        gesture.
+
+        * fast/events/popup-blocking-timers-expected.txt:
+        * fast/events/popup-blocking-timers.html:
+
 2012-09-11  Kent Tamura  <tk...@chromium.org>
 
         [Chromium] Test expectation update

Modified: trunk/LayoutTests/fast/events/popup-blocking-timers-expected.txt (128269 => 128270)


--- trunk/LayoutTests/fast/events/popup-blocking-timers-expected.txt	2012-09-12 07:02:02 UTC (rev 128269)
+++ trunk/LayoutTests/fast/events/popup-blocking-timers-expected.txt	2012-09-12 07:29:52 UTC (rev 128270)
@@ -1,4 +1,4 @@
-Click Here
+Click Here (6 times)
 Test calling window.open() directly. A popup should be allowed.
 PASS newWindow is non-null.
 Test calling window.open() with a 0 ms delay. A popup should be allowed.

Modified: trunk/LayoutTests/fast/events/popup-blocking-timers.html (128269 => 128270)


--- trunk/LayoutTests/fast/events/popup-blocking-timers.html	2012-09-12 07:02:02 UTC (rev 128269)
+++ trunk/LayoutTests/fast/events/popup-blocking-timers.html	2012-09-12 07:29:52 UTC (rev 128270)
@@ -4,6 +4,7 @@
         var newWindow;
         var intervalId;
         var firstIntervalExecution = true;
+        var clickNumber = 0;
         
         if (window.testRunner) {
             testRunner.dumpAsText();
@@ -13,57 +14,59 @@
         }
     
         function clickHandler() {
-            newWindow = window.open("about:blank");
-            self.focus();
-            debug("Test calling window.open() directly. A popup should be allowed.");
-            shouldBeNonNull("newWindow");
-                        
-            setTimeout(function() {
+            clickNumber++;
+            if (clickNumber == 1) {
                 newWindow = window.open("about:blank");
                 self.focus();
-                debug("Test calling window.open() with a 0 ms delay. A popup should be allowed.")
+                debug("Test calling window.open() directly. A popup should be allowed.");
                 shouldBeNonNull("newWindow");
-            }, 0);
-            
-            setTimeout(function() {
-                newWindow = window.open("about:blank");
-                self.focus();
-                debug("Test calling window.open() with a 1000 ms delay. A popup should be allowed.")
-                shouldBeNonNull("newWindow");
-            }, 1000);
-            
-            setTimeout(function() {
-                newWindow = window.open("about:blank");
-                self.focus();
-                debug("Test calling window.open() with a 1001 ms delay. A popup should not be allowed.")
-                shouldBeUndefined("newWindow");
-                
-                if (window.testRunner)
-                    testRunner.notifyDone();
-            }, 1001);
-            
-            intervalId = setInterval(function() {
-                debug("Test calling window.open() in a 100 ms interval. A popup should only be allowed on the first execution of the interval.");
-                newWindow = window.open("about:blank");
-                self.focus();
-                if (firstIntervalExecution) {
+            } else if (clickNumber == 2) {
+                setTimeout(function() {
+                    newWindow = window.open("about:blank");
+                    self.focus();
+                    debug("Test calling window.open() with a 0 ms delay. A popup should be allowed.")
                     shouldBeNonNull("newWindow");
-                    firstIntervalExecution = false;
-                } else {
-                    shouldBeUndefined("newWindow");
-                    clearInterval(intervalId);
-                }
-            }, 100);
-            
-            setTimeout(function() {
+                }, 0);
+            } else if (clickNumber == 3) {
+                intervalId = setInterval(function() {
+                    debug("Test calling window.open() in a 100 ms interval. A popup should only be allowed on the first execution of the interval.");
+                    newWindow = window.open("about:blank");
+                    self.focus();
+                    if (firstIntervalExecution) {
+                        shouldBeNonNull("newWindow");
+                        firstIntervalExecution = false;
+                    } else {
+                        shouldBeUndefined("newWindow");
+                        clearInterval(intervalId);
+                    }
+                }, 100);
+            } else if (clickNumber == 4) {
                 setTimeout(function() {
+                    setTimeout(function() {
+                        newWindow = window.open("about:blank");
+                        self.focus();
+                        debug("Test calling window.open() in a nested call to setTimeout(). A popup should not be allowed.")
+                        shouldBeUndefined("newWindow");
+                    }, 0);
+                }, 300);
+            } else if (clickNumber == 5) {
+                setTimeout(function() {
                     newWindow = window.open("about:blank");
                     self.focus();
-                    debug("Test calling window.open() in a nested call to setTimeout(). A popup should not be allowed.")
+                    debug("Test calling window.open() with a 1000 ms delay. A popup should be allowed.")
+                    shouldBeNonNull("newWindow");
+                }, 1000);
+            } else if (clickNumber == 6) {
+                setTimeout(function() {
+                    newWindow = window.open("about:blank");
+                    self.focus();
+                    debug("Test calling window.open() with a 1001 ms delay. A popup should not be allowed.")
                     shouldBeUndefined("newWindow");
-                }, 0);
-            }, 300);
-            
+
+                    if (window.testRunner)
+                        testRunner.notifyDone();
+                }, 1001);
+            }
             if (window.eventSender)
                 eventSender.leapForward(1001);
         }
@@ -73,14 +76,16 @@
             var buttonX = button.offsetLeft + button.offsetWidth / 2;
             var buttonY = button.offsetTop + button.offsetHeight / 2;
             if (window.eventSender) {
-                eventSender.mouseMoveTo(buttonX, buttonY);
-                eventSender.mouseDown();
-                eventSender.mouseUp();
+                for (var i = 0; i < 6; i++) { 
+                    eventSender.mouseMoveTo(buttonX, buttonY);
+                    eventSender.mouseDown();
+                    eventSender.mouseUp();
+                }
             }
         }        
     </script>
 </head>
 <body _onload_="clickButton()">
-    <button id="test" _onclick_="clickHandler()">Click Here</button>
+    <button id="test" _onclick_="clickHandler()">Click Here (6 times)</button>
     <div id="console"></div>
-</body>
\ No newline at end of file
+</body>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to