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> |