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

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

Issue 2778693004: Remove navigator.vibrate without user gesture. (Closed)
Patch Set: refactor SimulateUserClick 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/security/vibration/resources/vibrate-in-iframe-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/vibration/resources/vibrate-in-iframe-with-user-gesture-allowed.html
similarity index 80%
rename from third_party/WebKit/LayoutTests/http/tests/security/resources/cross-origin-iframe-for-vibrate-with-user-gesture-allowed.html
rename to third_party/WebKit/LayoutTests/http/tests/security/vibration/resources/vibrate-in-iframe-with-user-gesture-allowed.html
index 2e17ce2a6cdcb1aa8038ce16fcf0cbb6b0d9d696..7ba33ff96e76fedf5fafca698d14a7e28c9924be 100644
--- 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/vibration/resources/vibrate-in-iframe-with-user-gesture-allowed.html
@@ -4,7 +4,7 @@
<script src="/resources/testharnessreport.js"></script>
<script>
var test = async_test(
mustaq 2017/04/13 19:05:04 The async_test label seems redundant with the asse
binlu 2017/04/13 19:55:26 Done.
- "Testing vibrate 3 times in a x-origin iframe: " +
+ "Testing vibrate 3 times in an iframe: " +
" 1. blocked before user gesture;" +
" 2. succeed during the click event;" +
" 3. succeed after user click.");
@@ -15,18 +15,15 @@
function startTest(event)
{
- // A manual click should navigate.
+ // A manual click should enable vibrate.
if (window.eventSender) {
- var button = document.getElementById("b");
- eventSender.mouseMoveTo(button.offsetLeft + event.data.x + 2, button.offsetTop + event.data.y + 2);
test.step(function() {
assert_false(
navigator.vibrate(200),
"1. Blocked vibrate before user gesture.");
});
-
- eventSender.mouseDown();
- eventSender.mouseUp();
+ var element = document.getElementById("b");
+ simulateUserClick(element.offsetLeft + event.data.x + 2, element.offsetTop + event.data.y + 2);
}
}
@@ -58,3 +55,4 @@
<button id="b" onclick="performTestWithClick();">Perform Test</button>
</body>
</html>
+

Powered by Google App Engine
This is Rietveld 408576698