Changeset 128270 in webkit
- Timestamp:
- Sep 12, 2012 12:29:52 AM (12 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r128264 r128270 1 2012-09-12 Jochen Eisinger <jochen@chromium.org> 2 3 Change fast/events/popup-blocking-timers.html to generate a user action for each popup 4 https://bugs.webkit.org/show_bug.cgi?id=96475 5 6 Reviewed by Adam Barth. 7 8 The chromium port only allows one user gesture gated action per user 9 gesture. 10 11 * fast/events/popup-blocking-timers-expected.txt: 12 * fast/events/popup-blocking-timers.html: 13 1 14 2012-09-11 Kent Tamura <tkent@chromium.org> 2 15 -
trunk/LayoutTests/fast/events/popup-blocking-timers-expected.txt
r81057 r128270 1 Click Here 1 Click Here (6 times) 2 2 Test calling window.open() directly. A popup should be allowed. 3 3 PASS newWindow is non-null. -
trunk/LayoutTests/fast/events/popup-blocking-timers.html
r120792 r128270 5 5 var intervalId; 6 6 var firstIntervalExecution = true; 7 var clickNumber = 0; 7 8 8 9 if (window.testRunner) { … … 14 15 15 16 function clickHandler() { 16 newWindow = window.open("about:blank"); 17 self.focus(); 18 debug("Test calling window.open() directly. A popup should be allowed."); 19 shouldBeNonNull("newWindow"); 20 21 setTimeout(function() { 17 clickNumber++; 18 if (clickNumber == 1) { 22 19 newWindow = window.open("about:blank"); 23 20 self.focus(); 24 debug("Test calling window.open() with a 0 ms delay. A popup should be allowed.")21 debug("Test calling window.open() directly. A popup should be allowed."); 25 22 shouldBeNonNull("newWindow"); 26 }, 0); 27 28 setTimeout(function() { 29 newWindow = window.open("about:blank"); 30 self.focus(); 31 debug("Test calling window.open() with a 1000 ms delay. A popup should be allowed.") 32 shouldBeNonNull("newWindow"); 33 }, 1000); 34 35 setTimeout(function() { 36 newWindow = window.open("about:blank"); 37 self.focus(); 38 debug("Test calling window.open() with a 1001 ms delay. A popup should not be allowed.") 39 shouldBeUndefined("newWindow"); 40 41 if (window.testRunner) 42 testRunner.notifyDone(); 43 }, 1001); 44 45 intervalId = setInterval(function() { 46 debug("Test calling window.open() in a 100 ms interval. A popup should only be allowed on the first execution of the interval."); 47 newWindow = window.open("about:blank"); 48 self.focus(); 49 if (firstIntervalExecution) { 50 shouldBeNonNull("newWindow"); 51 firstIntervalExecution = false; 52 } else { 53 shouldBeUndefined("newWindow"); 54 clearInterval(intervalId); 55 } 56 }, 100); 57 58 setTimeout(function() { 23 } else if (clickNumber == 2) { 59 24 setTimeout(function() { 60 25 newWindow = window.open("about:blank"); 61 26 self.focus(); 62 debug("Test calling window.open() in a nested call to setTimeout(). A popup should not be allowed.") 27 debug("Test calling window.open() with a 0 ms delay. A popup should be allowed.") 28 shouldBeNonNull("newWindow"); 29 }, 0); 30 } else if (clickNumber == 3) { 31 intervalId = setInterval(function() { 32 debug("Test calling window.open() in a 100 ms interval. A popup should only be allowed on the first execution of the interval."); 33 newWindow = window.open("about:blank"); 34 self.focus(); 35 if (firstIntervalExecution) { 36 shouldBeNonNull("newWindow"); 37 firstIntervalExecution = false; 38 } else { 39 shouldBeUndefined("newWindow"); 40 clearInterval(intervalId); 41 } 42 }, 100); 43 } else if (clickNumber == 4) { 44 setTimeout(function() { 45 setTimeout(function() { 46 newWindow = window.open("about:blank"); 47 self.focus(); 48 debug("Test calling window.open() in a nested call to setTimeout(). A popup should not be allowed.") 49 shouldBeUndefined("newWindow"); 50 }, 0); 51 }, 300); 52 } else if (clickNumber == 5) { 53 setTimeout(function() { 54 newWindow = window.open("about:blank"); 55 self.focus(); 56 debug("Test calling window.open() with a 1000 ms delay. A popup should be allowed.") 57 shouldBeNonNull("newWindow"); 58 }, 1000); 59 } else if (clickNumber == 6) { 60 setTimeout(function() { 61 newWindow = window.open("about:blank"); 62 self.focus(); 63 debug("Test calling window.open() with a 1001 ms delay. A popup should not be allowed.") 63 64 shouldBeUndefined("newWindow"); 64 }, 0); 65 }, 300); 66 65 66 if (window.testRunner) 67 testRunner.notifyDone(); 68 }, 1001); 69 } 67 70 if (window.eventSender) 68 71 eventSender.leapForward(1001); … … 74 77 var buttonY = button.offsetTop + button.offsetHeight / 2; 75 78 if (window.eventSender) { 76 eventSender.mouseMoveTo(buttonX, buttonY); 77 eventSender.mouseDown(); 78 eventSender.mouseUp(); 79 for (var i = 0; i < 6; i++) { 80 eventSender.mouseMoveTo(buttonX, buttonY); 81 eventSender.mouseDown(); 82 eventSender.mouseUp(); 83 } 79 84 } 80 85 } … … 82 87 </head> 83 88 <body onload="clickButton()"> 84 <button id="test" onclick="clickHandler()">Click Here </button>89 <button id="test" onclick="clickHandler()">Click Here (6 times)</button> 85 90 <div id="console"></div> 86 91 </body>
Note: See TracChangeset
for help on using the changeset viewer.