| Index: third_party/WebKit/LayoutTests/http/tests/security/vibration/vibrate-on-top-page-before-during-after-user-gesture.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/security/vibration/vibrate-on-top-page-before-during-after-user-gesture.html b/third_party/WebKit/LayoutTests/http/tests/security/vibration/vibrate-on-top-page-before-during-after-user-gesture.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ac9056df51c6816824809b5b950ee3657fb5dbbe
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/security/vibration/vibrate-on-top-page-before-during-after-user-gesture.html
|
| @@ -0,0 +1,45 @@
|
| +<html>
|
| +<head>
|
| + <title>Testing vibrate 3 times on the top page</title>
|
| + <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()
|
| + {
|
| + test(function() {
|
| + assert_true(
|
| + navigator.vibrate(200),
|
| + "1. Vibrate w/o user gesture is deprecated and will be blocked in M60.");
|
| + });
|
| +
|
| + // A manual click should enable vibrate.
|
| + var element = document.getElementById("test");
|
| + simulateUserClick(element.offsetLeft + 2, element.offsetTop + 2);
|
| + performTestWithClick();
|
| + }
|
| +
|
| + function performTestWithClick()
|
| + {
|
| + test(function () {
|
| + assert_true(
|
| + navigator.vibrate(200),
|
| + "2. Vibrate triggered by user gesture succeeded.");
|
| + });
|
| + window.requestAnimationFrame(performTestAfterClick);
|
| + }
|
| +
|
| + function performTestAfterClick()
|
| + {
|
| + test(function () {
|
| + assert_true(
|
| + navigator.vibrate(200),
|
| + "3. Vibrate after user gesture succeeded.");
|
| + });
|
| + }
|
| + </script>
|
| +</head>
|
| +<body onload="startTest();">
|
| + <button id="test">Click to vibrate</button>
|
| +</body>
|
| +</html>
|
|
|