| <html> |
| <script src="../../resources/js-test-pre.js"></script> |
| |
| <script type="text/javascript"> |
| description('This tests that we can listen for webkitwillrevealbottom, webkitwillrevealtop, webkitwillrevealleft, and webkitwillrevealright'); |
| |
| var triggeredWillRevealBottom = false; |
| var triggeredWillRevealTop = false; |
| var triggeredWillRevealRight = false; |
| var triggeredWillRevealLeft = false; |
| |
| window.addEventListener( |
| 'webkitwillrevealbottom', |
| function() { |
| triggeredWillRevealBottom = true; |
| window.scrollTo(0,0); |
| checkComplete(); |
| }, |
| false); |
| |
| window.addEventListener( |
| 'webkitwillrevealtop', |
| function(event) { |
| triggeredWillRevealTop = true; |
| window.scrollTo(2000, 0); |
| checkComplete(); |
| }, |
| false); |
| |
| window.addEventListener( |
| 'webkitwillrevealright', |
| function(event) { |
| triggeredWillRevealRight = true; |
| window.scrollTo(0, 0); |
| checkComplete(); |
| }, |
| false); |
| |
| window.addEventListener( |
| 'webkitwillrevealleft', |
| function(event) { |
| triggeredWillRevealLeft = true; |
| checkComplete(); |
| }, |
| false); |
| |
| function checkComplete() |
| { |
| if (triggeredWillRevealBottom && triggeredWillRevealTop && triggeredWillRevealRight && triggeredWillRevealLeft) { |
| debug('All edges were revealed!'); |
| finishJSTest(); |
| } |
| } |
| |
| var jsTestIsAsync = true; |
| |
| function runTest() { |
| window.scrollTo(0, 2000); |
| } |
| </script> |
| |
| <body style="height:2000px; width:2000px;" onload="runTest()"> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |