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

Unified Diff: third_party/WebKit/LayoutTests/vibration/vibration-exceptions.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-exceptions.html
diff --git a/third_party/WebKit/LayoutTests/vibration/vibration-exceptions.html b/third_party/WebKit/LayoutTests/vibration/vibration-exceptions.html
index ee16c08ea9b7958fec472fb8b58f34fad2f61c15..ff0d57021cdb546d5517e8a555ae54e7daae095d 100644
--- a/third_party/WebKit/LayoutTests/vibration/vibration-exceptions.html
+++ b/third_party/WebKit/LayoutTests/vibration/vibration-exceptions.html
@@ -1,12 +1,18 @@
<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 that bad input throws exceptions in the Vibration API.');
+// Simulates a user click for vibrate to be allowed.
+var element = document.getElementById("test");
+simulateUserClick(element.offsetLeft + 2, element.offsetTop + 2);
+
shouldThrow("navigator.vibrate()");
shouldBe("navigator.vibrate(1, 2)", "true");
shouldBe("navigator.vibrate([1], [2])", "true");

Powered by Google App Engine
This is Rietveld 408576698