| <html> |
| <head> |
| <title>TouchScreen Click Test</title> |
| <style> |
| #touchtarget { |
| width: 100px; |
| height: 100px; |
| background: blue; |
| } |
| </style> |
| <script type="text/javascript" src="/touchtest.js"></script> |
| </head> |
| <body> |
| <div id="touchtarget"></div> |
| <p id="description"></p> |
| <div id="console"></div> |
| <script> |
| |
| window.DEBUG = true; //for the debug() function to print to console |
| |
| function onClick(event) { |
| var tolerance = 2; |
| debug(event.type + event.clientX + ' ' + event.clientY); |
| var status = 'FAIL'; |
| if ((Math.abs(event.clientX - 34) < tolerance) && |
| (Math.abs(event.clientY - 33) < tolerance)) |
| status = 'PASS'; |
| debug(status); |
| reportStatus(status); |
| return true; |
| } |
| |
| var div = document.getElementById('touchtarget'); |
| div.addEventListener('click', onClick, false); |
| debug('Replaying click'); |
| replayGesture('click1', null); |
| |
| </script> |
| </body> |
| </html> |