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

Unified Diff: third_party/WebKit/LayoutTests/vibration/vibration-patterns.html

Issue 2778693004: Remove navigator.vibrate without user gesture. (Closed)
Patch Set: refactor SimulateUserClick 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/vibration/vibration-patterns.html
diff --git a/third_party/WebKit/LayoutTests/vibration/vibration-patterns.html b/third_party/WebKit/LayoutTests/vibration/vibration-patterns.html
index ca254ea8a17ca655f852b45b6328d74ec9848224..ae07fed358ef69ffab47d826865059c3c47bc506 100644
--- a/third_party/WebKit/LayoutTests/vibration/vibration-patterns.html
+++ b/third_party/WebKit/LayoutTests/vibration/vibration-patterns.html
@@ -1,12 +1,19 @@
<html>
<head>
<script src="../resources/js-test.js"></script>
+<script src="../resources/user-gesture-utils.js"></script>
<script src="vibration-utils.js"></script>
</head>
<body>
+<h4 id="test"></h4>
<script>
description('Tests for how patterns are handled in the Vibration API.');
+// Simulates a user click for vibrate to be allowed.
+// See: https://www.chromestatus.com/feature/5644273861001216.
mustaq 2017/04/13 19:05:04 The chromestatus links here seem redundant because
binlu 2017/04/13 19:55:27 Will remove them shortly.
binlu 2017/04/18 15:48:29 Done.
+var element = document.getElementById("test");
+simulateUserClick(element.offsetLeft + 2, element.offsetTop + 2);
+
// A trailing pause is discarded from a pattern i.e. patterns of even
// non-zero length are truncated by 1.
shouldBeTrue("navigator.vibrate(newPattern(1, 4))");

Powered by Google App Engine
This is Rietveld 408576698