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

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

Issue 2767983003: Initial Implementation of Iframe Attribute for Feature Policy (Part 4) (Closed)
Patch Set: Codereview: nit + added more unit tests for container policy 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <script>
7 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.dumpChildFramesAsText();
10 }
11
12 function loaded() {
13 var iframe = document.getElementById("f1");
14 // Relocate iframe f1. Changing iframe.src will reload the document and update
15 // the policy.
16 iframe.src = "http://localhost:8000/feature-policy-experimental-features/resou rces/feature-policy-vibrate-enabled.html";
17 iframe.addEventListener("load", function() {
18 // The iframe uses eventSender to emulate a user navigatation, which
19 // requires absolute coordinates.
20 iframe.contentWindow.postMessage({x: iframe.offsetLeft, y: iframe.offsetTop} , "*");
21 });
22 }
23
24 // After updating document.location in iframe f2 (note that this does not cause
25 // document to reload therefore does not update the policy), use eventSender to
26 // triger navigator.vibrate.
27 function testVibrate() {
28 this.contentWindow.postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "* ");
29 }
30
31 </script>
32 </head>
33 <body onload="loaded()">
34 <iframe id="f1" src="about:blank" allow="vibrate"></iframe>
35 <iframe id="f2" src="resources/feature-policy-vibrate-relocate.html" onMessage=" testVibrate(this)" allow="vibrate"></iframe>
36 </body>
37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698