| Index: third_party/WebKit/LayoutTests/vibration/resources/vibrate-from-iframe.html
|
| diff --git a/third_party/WebKit/LayoutTests/vibration/resources/vibrate-from-iframe.html b/third_party/WebKit/LayoutTests/vibration/resources/vibrate-from-iframe.html
|
| index 4bcf5f5895993c96940a697cc217f09086e45317..a7f70d62952f2851a2abc1fe55914a55848767a1 100644
|
| --- a/third_party/WebKit/LayoutTests/vibration/resources/vibrate-from-iframe.html
|
| +++ b/third_party/WebKit/LayoutTests/vibration/resources/vibrate-from-iframe.html
|
| @@ -1,7 +1,32 @@
|
| <!DOCTYPE html>
|
| +<head>
|
| +<title>Test vibrate with user gesture in same-origin iframe</title>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script src="../../resources/user-gesture-utils.js"></script>
|
| <script>
|
| 'use strict';
|
|
|
| -navigator.vibrate(1234);
|
| +function startTest() {
|
| + if (window.eventSender) {
|
| + var iframes = window.parent.document.getElementsByTagName('iframe');
|
| + // The last iframe.
|
| + var iframe = iframes[iframes.length-1];
|
| + // Simulates a user click for vibrate to be allowed.
|
| + var element = document.getElementById("test");
|
| + simulateUserClick(element.offsetLeft + iframe.offsetLeft + 2, element.offsetTop + iframe.offsetTop + 2);
|
| + }
|
| +}
|
|
|
| +function testVibrate() {
|
| + test(function () {
|
| + assert_true(navigator.vibrate(200));
|
| + }, "An iframe may call navigator.vibrate with user gesture.");
|
| +}
|
| </script>
|
| +</head>
|
| +<body onload="startTest();">
|
| +<button id="test" onclick="testVibrate();">Click to vibrate</button>
|
| +</body>
|
| +</html>
|
| +
|
|
|