chromium/third_party/blink/web_tests/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-inner-late-composite.html

<!DOCTYPE html>
<html>
<head>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<script src="resources/link-highlight-helper.js"></script>
</head>
<body onLoad="runTest();">
<iframe id="nestingFrame" src="resources/1-nested-frame-noncomposited.html" style="position: relative; left: 10px; top: 10px; width: 450px; height: 150px; will-change: transform;"></iframe>
<div style="position: relative; left: 10px; top: 20px;">
This test is successful if "Target Link" is covered by a green box with square corners,
and the inner frame is partially scrolled.
</div>
<script>
function runTest() {
    useMockHighlight();
    var nestingFrame = document.getElementById('nestingFrame');
    var targetFrame = nestingFrame.contentDocument.getElementById('targetFrame');
    var clientRect = targetFrame.contentDocument.getElementById('targetLink').getBoundingClientRect();
    x = (clientRect.left + clientRect.right) / 2;
    y = (clientRect.top + clientRect.bottom) / 2 + nestingFrame.getBoundingClientRect().top + targetFrame.getBoundingClientRect().top;
    if (window.testRunner)
        testRunner.waitUntilDone();

    if (window.eventSender && window.testRunner) {
        eventSender.gestureShowPress(x, y);
        runAfterLayoutAndPaint(function() {
            targetFrame.style.willChange = "transform";
            runAfterLayoutAndPaint(function() {
                targetFrame.contentWindow.scrollTo(0, 20);
                testRunner.notifyDone();
            });
        });
    } else {
        debug("This test requires DumpRenderTree.");
    }
}
</script>
</body>
</html>