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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall.php b/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall.php
index 471f7b05bef19d1763655c6a3cafd20a3ace4252..50c03732d3efcfbde0dd322e8869f0e939a51a44 100644
--- a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall.php
+++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall.php
@@ -15,13 +15,22 @@ Header("Feature-Policy: {\"vibrate\": [\"*\"]}");
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.dumpChildFramesAsText();
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+}
+
+function loaded() {
+ var iframes = document.getElementsByTagName('iframe');
+ for (var i = 0; i < iframes.length; ++i) { // < 1; ++i) { //
+ var iframe = iframes[i];
+ // The iframe uses eventSender to emulate a user navigatation, which requires absolute coordinates.
+ iframe.contentWindow.postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "*");
}
+}
</script>
</head>
-<body>
+<body onload="loaded();">
<iframe id="f1" src="resources/feature-policy-vibrate-enabled.html"></iframe>
<iframe id="f2" src="http://localhost:8000/feature-policy/resources/feature-policy-vibrate-enabled.html"></iframe>
</body>

Powered by Google App Engine
This is Rietveld 408576698