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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall.php

Issue 2778693004: Remove navigator.vibrate without user gesture. (Closed)
Patch Set: rebase Created 3 years, 8 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 <?php 1 <?php
2 // Copyright 2016 The Chromium Authors. All rights reserved. 2 // Copyright 2016 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 // This test ensures that navigator.vibrate when enabled for all works across 6 // This test ensures that navigator.vibrate when enabled for all works across
7 // origins. 7 // origins.
8 8
9 Header("Feature-Policy: {\"vibrate\": [\"*\"]}"); 9 Header("Feature-Policy: {\"vibrate\": [\"*\"]}");
10 ?> 10 ?>
11 11
12 <!DOCTYPE html> 12 <!DOCTYPE html>
13 <html> 13 <html>
14 <head> 14 <head>
15 <script src="../../resources/testharness.js"></script> 15 <script src="../../resources/testharness.js"></script>
16 <script src="../../resources/testharnessreport.js"></script> 16 <script src="../../resources/testharnessreport.js"></script>
17 <script> 17 <script>
18 if (window.testRunner) { 18 if (window.testRunner) {
19 testRunner.dumpAsText(); 19 testRunner.dumpAsText();
20 testRunner.dumpChildFramesAsText(); 20 testRunner.dumpChildFramesAsText();
21 }
22
23 function loaded() {
24 var iframes = document.getElementsByTagName('iframe');
25 for (var i = 0; i < iframes.length; ++i) { // < 1; ++i) { //
26 var iframe = iframes[i];
27 // The iframe uses eventSender to emulate a user navigatation, which require s absolute coordinates.
28 iframe.contentWindow.postMessage({x: iframe.offsetLeft, y: iframe.offsetTop} , "*");
21 } 29 }
30 }
22 </script> 31 </script>
23 </head> 32 </head>
24 <body> 33 <body onload="loaded();">
25 <iframe id="f1" src="resources/feature-policy-vibrate-enabled.html"></iframe> 34 <iframe id="f1" src="resources/feature-policy-vibrate-enabled.html"></iframe>
26 <iframe id="f2" src="http://localhost:8000/feature-policy/resources/feature-poli cy-vibrate-enabled.html"></iframe> 35 <iframe id="f2" src="http://localhost:8000/feature-policy/resources/feature-poli cy-vibrate-enabled.html"></iframe>
27 </body> 36 </body>
28 </html> 37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698