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

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

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/vibration/vibration-durations.html
diff --git a/third_party/WebKit/LayoutTests/vibration/vibration-durations.html b/third_party/WebKit/LayoutTests/vibration/vibration-durations.html
index b83f4a136494541a43541a87fc5d97941ff58ce3..49a5791b3c108c70db9712215a5d338b816153dc 100644
--- a/third_party/WebKit/LayoutTests/vibration/vibration-durations.html
+++ b/third_party/WebKit/LayoutTests/vibration/vibration-durations.html
@@ -1,12 +1,23 @@
<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 durations are handled in the Vibration API.');
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+}
+
+// Simulates a user click for vibrate to be allowed.
+var element = document.getElementById("test");
+simulateUserClick(element.offsetLeft + 2, element.offsetTop + 2);
+
// Empty pattern is empty. Does not start a vibration.
shouldBeTrue("navigator.vibrate([])");
shouldBeTrue("areArraysEqual(internals.pendingVibrationPattern(navigator), [])");

Powered by Google App Engine
This is Rietveld 408576698