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

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

Issue 2855133004: Re-enable feature policy layout tests after bug fix. (Closed)
Patch Set: Rebased FlagExpectations/site-per-process 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 <html>
3 <head>
4 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <iframe allow="vibrate"></iframe>
6 <script> 5 <script>
7 if (window.testRunner) { 6 var srcs = [
8 testRunner.dumpAsText(); 7 "resources/feature-policy-vibrate.html",
9 testRunner.dumpChildFramesAsText(); 8 "http://localhost:8000/feature-policy-experimental-features/resources/feature- policy-vibrate.html"];
9
10 function sendClick() {
iclelland 2017/05/18 19:40:59 This function could probably be moved into a littl
lunalu1 2017/05/19 20:54:08 Done
11 // The iframe uses eventSender to emulate a user navigatation, which requires
12 // absolute coordinates.
13 this.contentWindow.postMessage({x: this.offsetLeft, y: this.offsetTop}, "*");
10 } 14 }
11 15
12 function loaded() { 16 window.onload = function () {
13 var iframes = document.getElementsByTagName('iframe'); 17 var iframe = document.querySelector('iframe');
14 for (var i = 0; i < iframes.length; ++i) { // < 1; ++i) { // 18 iframe.addEventListener('load', sendClick);
15 var iframe = iframes[i]; 19 function loadFrame(src) {
16 // The iframe uses eventSender to emulate a user navigatation, which require s absolute coordinates. 20 promise_test(function() {
17 iframe.contentWindow.postMessage({x: iframe.offsetLeft, y: iframe.offsetTop} , "*"); 21 iframe.src = src;
22 return new Promise(function(resolve, reject) {
23 window.addEventListener('message', function(e) {
24 if (e.data.type === 'result') {
25 resolve(e.data);
26 }
27 });
28 }).then(function(data) {
29 assert_true(data.enabled, 'navigator.vibrate():');
30 });
31 }, 'Navigator.vibrate enabled by container policy on URL: ' + src);
32 }
33 for (var src of srcs) {
34 loadFrame(src);
iclelland 2017/05/18 19:36:12 Will/could this set the iframe src attribute a sec
iclelland 2017/05/18 19:56:58 I had a look, to re-learn how promise_test worked,
lunalu1 2017/05/19 20:54:08 :)
18 } 35 }
19 } 36 }
20 </script> 37 </script>
21 </head>
22 <body onload="loaded();">
23 <iframe id="f1" src="resources/feature-policy-vibrate-enabled.html" allow="vibra te"></iframe>
24 <iframe id="f2" src="http://localhost:8000/feature-policy/feature-policy-vibrate -enabled.html" allow="vibrate"></iframe>
25 </body>
26 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698