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

Unified Diff: Source/web/tests/data/touch-action-tests.js

Issue 16507017: Initial touch-action main thread implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Don't add delay param to public API just yet Created 7 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: Source/web/tests/data/touch-action-tests.js
diff --git a/Source/web/tests/data/touch-action-tests.js b/Source/web/tests/data/touch-action-tests.js
new file mode 100644
index 0000000000000000000000000000000000000000..38ac3015d072be8d831c9c870c7af733991ba734
--- /dev/null
+++ b/Source/web/tests/data/touch-action-tests.js
@@ -0,0 +1,26 @@
+// For manual testing, disable compositor hit testing
+document.addEventListener('touchstart', function() {});
+
+/*
+ * Visualization of hit test locations for manual testing.
+ * Note that JS is not run as part of the unit test.
+ */
+function addMarker(x, y)
+{
+ const kMarkerSize = 6;
+ var marker = document.createElement('div');
+ marker.className = 'marker';
+ marker.style.top = (y - kMarkerSize/2) + "px";
+ marker.style.left = (x - kMarkerSize/2) + "px";
+ document.body.appendChild(marker);
+}
+
+window.addEventListener('load', function() {
+ var tests = document.querySelectorAll('[expected-action]');
+ for( var i = 0; i < tests.length; i++) {
+ var r = tests[i].getClientRects()[0];
+ addMarker(r.left, r.top);
+ addMarker(r.right - 1, r.bottom - 1);
+ addMarker(r.left + r.width / 2, r.top + r.height / 2);
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698