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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/resources/feature-policy-vibrate.html

Issue 2855133004: Re-enable feature policy layout tests after bug fix. (Closed)
Patch Set: Updated fp-vibrate tests expect Created 3 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Feature-Policy Vibrate</title>
3 <script src="/js-test-resources/user-gesture-utils.js"></script>
4 <button id="test">Click to vibrate</button>
5 <script>
6 function startTest(event) {
7 // Simulates a user click for vibrate to be allowed.
8 var element = document.getElementById('test');
9 document.querySelector('button').addEventListener('click', testVibrate);
10 simulateUserClick(element.offsetLeft + event.data.x + 2,
11 element.offsetTop + event.data.y + 2);
12 }
13
14 function testVibrate() {
15 if (navigator.vibrate(200)) {
16 parent.postMessage({ type: 'result', enabled: true }, '*');
17 } else {
18 parent.postMessage({ type: 'result', enabled: false }, '*');
19 }
20 }
21
22 window.addEventListener('message', startTest, true);
23 window.addEventListener('load', function() {
24 parent.postMessage({ type: 'onload'}, '*');
25 });
26 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698