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

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

Issue 2814153002: Move feature policy vibrate tests to correct directory (Closed)
Patch Set: Update test 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <head> 2 <head>
3 <title>Feature-Policy Vibrate Disabled</title> 3 <title>Feature-Policy Vibrate Disabled</title>
4 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script> 5 <script src="/resources/testharnessreport.js"></script>
6 <script src="/js-test-resources/user-gesture-utils.js"></script> 6 <script src="/js-test-resources/user-gesture-utils.js"></script>
7 <script> 7 <script>
8 8
9 function startTest(event) { 9 function startTest(event) {
10 // Simulates a user click for vibrate to be allowed. 10 // Simulates a user click for vibrate to be allowed.
11 var element = document.getElementById("test"); 11 var element = document.getElementById("test");
12 simulateUserClick(element.offsetLeft + event.data.x + 2, element.offsetTop + e vent.data.y + 2); 12 simulateUserClick(element.offsetLeft + event.data.x + 2, element.offsetTop + e vent.data.y + 2);
13 } 13 }
14 14
15 function testVibrate() { 15 function testVibrate() {
16 test(function () { 16 test(function () {
17 assert_false(navigator.vibrate(200)); 17 assert_false(navigator.vibrate(200));
18 }, 'No iframe may call navigator.vibrate when disabled.'); 18 }, 'No iframe may call navigator.vibrate when disabled.');
19 } 19 }
20 20
21 window.addEventListener("message", startTest, true); 21 window.addEventListener("message", startTest, true);
22 </script> 22 </script>
23 <body> 23 <body>
24 <button id="test" onclick="testVibrate();">Click to vibrate</button> 24 <button id="test" onclick="testVibrate();">Click to vibrate</button>
25 25 </body>
26 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698