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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/resources/cross-origin-iframe-for-vibrate-with-user-gesture-allowed.html

Issue 2642263006: Allow vibrate in cross-origin iframes with user gesture. (Closed)
Patch Set: Fix test failure of enabledforall. Created 3 years, 11 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 <html>
2 <head>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <script>
6 function loaded()
7 {
8 document.getElementsByTagName('h4')[0].innerHTML = document.domain;
9 }
10
11 function startTest(event)
12 {
13 // A manual click should navigate.
14 if (window.eventSender) {
15 var button = document.getElementById("b");
16 eventSender.mouseMoveTo(button.offsetLeft + event.data.x + 2, bu tton.offsetTop + event.data.y + 2);
17 eventSender.mouseDown();
18 eventSender.mouseUp();
19 }
20 }
21
22 function performTest()
23 {
24 test(function () {
Rick Byers 2017/01/23 15:42:14 This tests that virbrate is allowed when triggered
Bin Lu 2017/01/23 20:18:40 Done.
25 assert_true(navigator.vibrate(200));
26 }, "A cross-origin iframe with user gesture may call navigator.vibrate .");
27 }
28
29 window.addEventListener("message", startTest, false);
30 </script>
31 </head>
32 <body onload="loaded();">
33 <h4>DOMAIN</h4>
34 <button id="b" onclick="performTest();">Perform Test</button>
35 </body>
36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698