| Index: third_party/WebKit/LayoutTests/http/tests/security/vibration/resources/vibrate-with-user-gesture-allowed.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/security/vibration/resources/vibrate-with-user-gesture-allowed.html b/third_party/WebKit/LayoutTests/http/tests/security/vibration/resources/vibrate-with-user-gesture-allowed.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a011f3459eaa9db8e70d33d90100f3e40a769d32
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/security/vibration/resources/vibrate-with-user-gesture-allowed.html
|
| @@ -0,0 +1,27 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script src="/resources/testharness.js"></script>
|
| +<script src="/resources/testharnessreport.js"></script>
|
| +<script src="/js-test-resources/user-gesture-utils.js"></script>
|
| +<script>
|
| +
|
| +function startTest(event) {
|
| + // Simulates a user click for vibrate to be allowed.
|
| + var element = document.getElementById("test");
|
| + simulateUserClick(element.offsetLeft + event.data.x + 2, element.offsetTop + event.data.y + 2);
|
| +}
|
| +
|
| +function testVibrate() {
|
| + test(function () {
|
| + assert_true(navigator.vibrate(200));
|
| + }, "An iframe may call navigator.vibrate with user gesture.");
|
| +}
|
| +
|
| +window.addEventListener("message", startTest, false);
|
| +</script>
|
| +</head>
|
| +<body>
|
| +<button id="test" onclick="testVibrate();">Click to vibrate</button>
|
| +</body>
|
| +</html>
|
|
|