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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/touch/touch-action-preventDefault.html

Issue 2520423004: Don't log a console warning when touch-action is used. (Closed)
Patch Set: Add layout test Created 4 years, 1 month 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/fast/events/touch/touch-action-preventDefault.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-preventDefault.html b/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-preventDefault.html
new file mode 100644
index 0000000000000000000000000000000000000000..142e402d39ed3b0494e451dd40fc893eb8b89971
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-preventDefault.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<script src='../../../resources/testharness.js'></script>
+<script src='../../../resources/testharnessreport.js'></script>
+<style>
+ #first {width: 100px; height: 50px; }
+ #second {width: 100px; height: 50px; touch-action: none;}
+</style>
+<body>
+ <div id="first"></div>
+ <div id="second"></div>
+<script>
+test(function() {
+ var handler = (e) => {e.preventDefault();};
+ window.addEventListener('touchstart', handler);
+ eventSender.addTouchPoint(15, 15);
+ eventSender.touchStart();
+ eventSender.clearTouchPoints();
+ window.removeEventListener('touchstart', handler);
+}, 'Forced passive event listener');
+test(function() {
+ var handler = (e) => {e.preventDefault();};
+ window.addEventListener('touchstart', handler);
+ eventSender.addTouchPoint(15, 70);
+ eventSender.touchStart();
+ window.removeEventListener('touchstart', handler);
+}, 'Forced passive event listener with touch-action');
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698