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

Unified Diff: third_party/WebKit/LayoutTests/resources/user-gesture-utils.js

Issue 2778693004: Remove navigator.vibrate without user gesture. (Closed)
Patch Set: rebase Created 3 years, 8 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/resources/user-gesture-utils.js
diff --git a/third_party/WebKit/LayoutTests/resources/user-gesture-utils.js b/third_party/WebKit/LayoutTests/resources/user-gesture-utils.js
new file mode 100644
index 0000000000000000000000000000000000000000..35defbb2287e6b14527eabf988fc7e328c9fd386
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/resources/user-gesture-utils.js
@@ -0,0 +1,13 @@
+/**
+ * Simulates a user click on coordinates [x], [y].
+ * For example, for vibrate to be allowed:
+ * https://www.chromestatus.com/feature/5644273861001216.
+ */
+function simulateUserClick(x, y) {
+ if (window.eventSender) {
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
+}
+

Powered by Google App Engine
This is Rietveld 408576698