Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / touch / compositor-touch-hit-rects-global.html
blob7c748e73ca7de6f6c87cc15e5492f6fac2a195c5
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <link rel="stylesheet" href="resources/compositor-touch-hit-rects.css">
5 <style>
6 body {
7 /* make it easy to validate rects are covering the entire document */
8 height: 1968px;
9 margin: 16px 5px;
11 </style>
12 </head>
13 <body>
14 <p id="description">
15 This tests verifies the hit test regions given to the compositor in the simple case where
16 touch handles cover (or nearly cover) the entire document. It can only be run in DumpRenderTree.
17 </p>
19 <div id="tests">
20 </div>
22 <div id="console"></div>
23 <script src="resources/compositor-touch-hit-rects.js"></script>
24 <script>
26 function runGlobalTest(name, element) {
27 // With a global handler, no other handlers should matter
28 var elements = [document.getElementById('description'), element, document.getElementById('tests')];
29 for (var i = 0; i < elements.length; i++)
30 elements[i].addEventListener('touchmove', listener, false);
32 logRects(name, true);
34 for (var i = 0; i < elements.length; i++)
35 elements[i].removeEventListener('touchmove', listener, false);
38 function runOverlayTest() {
39 if (window.testRunner)
40 testRunner.addWebPageOverlay();
42 logRects('webPageOverlay', true);
44 if (window.testRunner)
45 testRunner.removeWebPageOverlay();
48 function additionalTests() {
49 runGlobalTest('document', document);
50 runGlobalTest('html', document.documentElement);
51 runGlobalTest('body', document.body);
52 runOverlayTest();
54 </script>
55 </body>