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

Unified Diff: LayoutTests/fast/events/touch/overlayfullscreenvideo/compositor-touch-hit-rects-fullscreen-video-controls.html

Issue 317373007: Report correct touch hit rects for fullscreen HTML5 video on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add virtual test Created 6 years, 6 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: LayoutTests/fast/events/touch/overlayfullscreenvideo/compositor-touch-hit-rects-fullscreen-video-controls.html
diff --git a/LayoutTests/fast/events/touch/overlayfullscreenvideo/compositor-touch-hit-rects-fullscreen-video-controls.html b/LayoutTests/fast/events/touch/overlayfullscreenvideo/compositor-touch-hit-rects-fullscreen-video-controls.html
new file mode 100644
index 0000000000000000000000000000000000000000..52ae9f2940b476266359d1c7b09418b643772b26
--- /dev/null
+++ b/LayoutTests/fast/events/touch/overlayfullscreenvideo/compositor-touch-hit-rects-fullscreen-video-controls.html
@@ -0,0 +1,52 @@
+<body>
+<p id="discription">
+This test makes sure that touch hit rects are reported for fullscreen HTML5
+video control elements when
+RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() is true.
+</p>
+<video id="video" width="300"></video>
+<script src="../../../../fullscreen/full-screen-test.js"></script>
+<script>
+window.onload = function () {
+ document.addEventListener('touchstart', function() { });
+
+ function nameForNode(node) {
+ if (!node)
+ return "[unknown-node]";
+ var name = node.nodeName;
+ if (node.id)
+ name += '#' + node.id;
+ return name;
+ }
+
+ function logRects(fullscreen) {
Rick Byers 2014/06/10 21:39:57 rather than copy/paste code from the touch hit tes
+ var rects = window.internals.touchEventTargetLayerRects(document);
+ for ( var i = 0; i < rects.length; ++i) {
+ var node = rects[i].layerAssociatedNode;
+ var r = rects[i].layerRelativeRect;
+ var nameSuffix = "";
+ if (rects[i].layerType)
+ nameSuffix += " " + rects[i].layerType;
+ var offsetX = rects[i].associatedNodeOffsetX;
+ var offsetY = rects[i].associatedNodeOffsetY;
+ if (offsetX || offsetY)
+ nameSuffix += "[" + offsetX + "," + offsetY + "]"
+ var name = nameForNode(node);
+ logResult((name != '#document') == fullscreen, name + nameSuffix + " ("
+ + r.left + ", " + r.top + ", " + r.width + ", " + r.height + ")");
+ }
+ }
+
+ consoleWrite("Should have single rect on document before fullscreen");
+ logRects(false);
+
+ waitForEvent(document, 'webkitfullscreenchange', function() {
+ consoleWrite("Should report another rect which is not on the document");
+ logRects(true);
+ endTest();
+ });
+
+ runWithKeyDown(function(){document.querySelector('#video').webkitRequestFullScreen()});
+}
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698