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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/resources/cross-origin-iframe-for-vibrate-with-user-gesture-allowed.html

Issue 2642263006: Allow vibrate in cross-origin iframes with user gesture. (Closed)
Patch Set: Fix test failure of enabledforall. Created 3 years, 11 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/security/resources/cross-origin-iframe-for-vibrate-with-user-gesture-allowed.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/resources/cross-origin-iframe-for-vibrate-with-user-gesture-allowed.html b/third_party/WebKit/LayoutTests/http/tests/security/resources/cross-origin-iframe-for-vibrate-with-user-gesture-allowed.html
new file mode 100644
index 0000000000000000000000000000000000000000..d3a20abf39ca8c28c4db38a1250fdf4248bb30aa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/resources/cross-origin-iframe-for-vibrate-with-user-gesture-allowed.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ function loaded()
+ {
+ document.getElementsByTagName('h4')[0].innerHTML = document.domain;
+ }
+
+ function startTest(event)
+ {
+ // A manual click should navigate.
+ if (window.eventSender) {
+ var button = document.getElementById("b");
+ eventSender.mouseMoveTo(button.offsetLeft + event.data.x + 2, button.offsetTop + event.data.y + 2);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
+ }
+
+ function performTest()
+ {
+ test(function () {
Rick Byers 2017/01/23 15:42:14 This tests that virbrate is allowed when triggered
Bin Lu 2017/01/23 20:18:40 Done.
+ assert_true(navigator.vibrate(200));
+ }, "A cross-origin iframe with user gesture may call navigator.vibrate.");
+ }
+
+ window.addEventListener("message", startTest, false);
+ </script>
+</head>
+<body onload="loaded();">
+ <h4>DOMAIN</h4>
+ <button id="b" onclick="performTest();">Perform Test</button>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698