Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <script src="../../resources/testharness.js"></script> | |
|
mustaq
2016/10/07 19:06:21
Since LayoutTests/fast/events contains hundreds of
Navid Zolghadr
2016/10/11 13:19:26
Sure.
| |
| 2 <script src="../../resources/testharnessreport.js"></script> | |
| 3 <p> | |
| 4 Test that only a single popup is allowed in response to a single | |
| 5 pointer up user action. The test passes if only one popup is created. | |
| 6 </p> | |
| 7 <button id="button">Tap Here</button> | |
| 8 <div id="console"></div> | |
| 9 <script> | |
| 10 document.getElementById('button').addEventListener('pointerup', popup); | |
| 11 function popup() { | |
| 12 assert_not_equals(window.open("about:blank", "window1"), null, "Popup di dn't open in pointerup handler."); | |
| 13 assert_equals(window.open("about:blank", "window2"), null, "Popup should open only once in pointerup handler."); | |
| 14 done(); | |
| 15 } | |
| 16 | |
| 17 if (window.testRunner) { | |
| 18 testRunner.setPopupBlockingEnabled(true); | |
| 19 testRunner.setCloseRemainingWindowsWhenComplete(true); | |
| 20 | |
| 21 if (window.eventSender) { | |
| 22 var button = document.getElementById("button"); | |
| 23 eventSender.addTouchPoint(button.offsetLeft + button.offsetWidth / 2 , button.offsetTop + button.offsetHeight / 2); | |
| 24 eventSender.touchStart(); | |
| 25 eventSender.releaseTouchPoint(0); | |
| 26 eventSender.touchEnd(); | |
| 27 } | |
|
Rick Byers
2016/10/11 15:08:50
nit: assert that the popup function was actually r
Navid Zolghadr
2016/10/12 15:18:01
It times out if that doesn't run. At least this is
| |
| 28 } | |
| 29 </script> | |
| OLD | NEW |