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

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

Issue 2855133004: Re-enable feature policy layout tests after bug fix. (Closed)
Patch Set: Updated fp-vibrate tests expect Created 3 years, 6 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 disabled may not be called by 6 // This test ensures that navigator.vibrate when disabled may not be called by
7 // any iframe. 7 // any iframe.
8 8
9 Header("Feature-Policy: {\"vibrate\": []}"); 9 Header("Feature-Policy: {\"vibrate\": []}");
10 ?> 10 ?>
11 11
12 <!DOCTYPE html> 12 <!DOCTYPE html>
13 <html>
14 <head>
15 <script src="../../resources/testharness.js"></script> 13 <script src="../../resources/testharness.js"></script>
16 <script src="../../resources/testharnessreport.js"></script> 14 <script src="../../resources/testharnessreport.js"></script>
15 <script src="resources/helper.js"></script>
16 <iframe></iframe>
17 <script> 17 <script>
18 if (window.testRunner) { 18 var srcs = [
19 testRunner.dumpAsText(); 19 "resources/feature-policy-vibrate.html",
20 testRunner.dumpChildFramesAsText(); 20 "http://localhost:8000/feature-policy-experimental-features/resources/feature- policy-vibrate.html"];
21 }
22 21
23 function loaded() { 22 window.onload = function () {
24 var iframes = document.getElementsByTagName('iframe'); 23 var iframe = document.querySelector('iframe');
25 for (var i = 0; i < iframes.length; ++i) { 24 iframe.addEventListener('load', sendClick);
26 var iframe = iframes[i]; 25 function loadFrame(src) {
27 // The iframe uses eventSender to emulate a user navigatation, which require s absolute coordinates. 26 promise_test(function() {
28 iframe.contentWindow.postMessage({x: iframe.offsetLeft, y: iframe.offsetTop} , "*"); 27 iframe.src = src;
28 return new Promise(function(resolve, reject) {
29 window.addEventListener('message', function(e) {
30 if (e.data.type === 'result') {
31 resolve(e.data);
32 }
33 });
34 }).then(function(data) {
35 assert_false(data.enabled, 'navigator.vibrate():');
36 });
37 }, 'Navigator.vibrate disabled on URL: ' + src);
38 }
39 for (var src of srcs) {
40 loadFrame(src);
29 } 41 }
30 } 42 }
31 </script> 43 </script>
32 </head>
33 <body onload="loaded();">
34 <iframe id="f1" src="resources/feature-policy-vibrate-disabled.html"></iframe>
35 <iframe id="f2" src="http://localhost:8000/feature-policy-experimental-features/ resources/feature-policy-vibrate-disabled.html"></iframe>
36 </body>
37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698