| Index: LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch.html
|
| diff --git a/LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch.html b/LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b153443d6bcc658efcde35fef5ef5588f443b77d
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch.html
|
| @@ -0,0 +1,109 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script src="../../../../resources/js-test.js"></script>
|
| +<link rel="stylesheet" href="../resources/touch-hover-active-tests.css">
|
| +<style>
|
| +#box {
|
| + width: 300px;
|
| + height: 50px;
|
| +}
|
| +
|
| +#overflowBox {
|
| + width: 300px;
|
| + height: 600px;
|
| +}
|
| +
|
| +#container {
|
| + width: 300px;
|
| + height: 50px;
|
| + overflow-y: scroll;
|
| + overflow-x: hidden;
|
| + margin: 10px 0 10px 0;
|
| +}
|
| +
|
| +#spacer {
|
| + display: none;
|
| + width: 100px;
|
| + height: 600px;
|
| +}
|
| +</style>
|
| +</head>
|
| +<body>
|
| +<div id="box" class="touch-interactive">Gestures go here</div>
|
| +<div id="container">
|
| + <div id="overflowBox" class="touch-interactive">Gestures go here</div>
|
| +</div>
|
| +
|
| +<p id="description"></p>
|
| +<p>See http://crbug.com/316974 for details</p>
|
| +
|
| +<div id="console"></div>
|
| +
|
| +<div id="spacer"></div>
|
| +
|
| +<script src="../resources/touch-hover-active-tests.js"></script>
|
| +<script>
|
| +var box = document.getElementById("box");
|
| +var container = document.getElementById("container");
|
| +var overflowBox = document.getElementById("overflowBox");
|
| +
|
| +if (window.internals) {
|
| + internals.settings.setViewportEnabled(true);
|
| + internals.settings.setViewportMetaEnabled(true);
|
| +}
|
| +
|
| +description("Tests gesture tapdown behaviour on different scroll / pinch settings.");
|
| +
|
| +function runTests()
|
| +{
|
| + if (!window.eventSender) {
|
| + debug('This test requires DRT.');
|
| + return;
|
| + }
|
| +
|
| + if (!eventSender.gestureTapDown
|
| + || !eventSender.gestureShowPress) {
|
| + debug('Gesture events are not supported by this platform');
|
| + return;
|
| + }
|
| +
|
| + // Insert meta tag after viewport has been enabled via internals
|
| + var meta = document.createElement('meta');
|
| + meta.name = 'viewport';
|
| + meta.content = 'initial-scale=1, maximum-scale=2';
|
| + document.head.appendChild(meta);
|
| +
|
| + // Verify behaviour when page is pinchable
|
| + debug("Scroll disabled, Pinch enabled.");
|
| + var boxLocation = elementCenter(box);
|
| + hasEarlyShowPress("getHoverActiveState(box)", boxLocation, false);
|
| +
|
| + // Send a sequence to another element to clear current one without relying on tap
|
| + var containerLocation = elementCenter(container);
|
| + eventSender.gestureTapDown(containerLocation.x, containerLocation.y);
|
| + eventSender.gestureShowPress(containerLocation.x, containerLocation.y);
|
| + eventSender.gestureTapCancel(containerLocation.x, containerLocation.y);
|
| +
|
| + // Update viewport to make page non-pinchable
|
| + meta.content = 'width=device-width, initial-scale=1, user-scalable=no';
|
| +
|
| + // Verify behaviour when page isn't scrollable or pinchable
|
| + debug("Scroll disabled, Pinch disabled.");
|
| + hasEarlyShowPress("getHoverActiveState(box)", boxLocation, true);
|
| +
|
| + // Verify behaviour when ancestor is scrollable
|
| + debug("overflowBox with scrollable ancestor.");
|
| + hasEarlyShowPress("getHoverActiveState(overflowBox)", containerLocation, false);
|
| +
|
| + // Now check when page becomes scrollable
|
| + document.getElementById('spacer').style.display = 'block';
|
| + debug("Scroll enabled, Pinch disabled.");
|
| + hasEarlyShowPress("getHoverActiveState(box)", boxLocation, false);
|
| +}
|
| +
|
| +window.onload = runTests;
|
| +</script>
|
| +</body>
|
| +</html>
|
| +
|
|
|