Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: third_party/WebKit/LayoutTests/fast/events/popup-allowed-from-pointerup-exactly-once.html

Issue 2401643005: Create user gesture indicator for pointerup (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698