Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/events/popup-allowed-from-pointerup-exactly-once.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/events/popup-allowed-from-pointerup-exactly-once.html b/third_party/WebKit/LayoutTests/fast/events/popup-allowed-from-pointerup-exactly-once.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2c97de97783525675fbc8e20bd0eb611c80374a1 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/events/popup-allowed-from-pointerup-exactly-once.html |
| @@ -0,0 +1,29 @@ |
| +<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.
|
| +<script src="../../resources/testharnessreport.js"></script> |
| +<p> |
| + Test that only a single popup is allowed in response to a single |
| + pointer up user action. The test passes if only one popup is created. |
| +</p> |
| +<button id="button">Tap Here</button> |
| +<div id="console"></div> |
| +<script> |
| + document.getElementById('button').addEventListener('pointerup', popup); |
| + function popup() { |
| + assert_not_equals(window.open("about:blank", "window1"), null, "Popup didn't open in pointerup handler."); |
| + assert_equals(window.open("about:blank", "window2"), null, "Popup should open only once in pointerup handler."); |
| + done(); |
| + } |
| + |
| + if (window.testRunner) { |
| + testRunner.setPopupBlockingEnabled(true); |
| + testRunner.setCloseRemainingWindowsWhenComplete(true); |
| + |
| + if (window.eventSender) { |
| + var button = document.getElementById("button"); |
| + eventSender.addTouchPoint(button.offsetLeft + button.offsetWidth / 2, button.offsetTop + button.offsetHeight / 2); |
| + eventSender.touchStart(); |
| + eventSender.releaseTouchPoint(0); |
| + eventSender.touchEnd(); |
| + } |
|
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
|
| + } |
| +</script> |