| <!DOCTYPE HTML> |
| <html> |
| <head> |
| <script src="../resources/js-test.js"></script> |
| <style> |
| .bigbutton { |
| display:block; |
| width: 600px; |
| height: 600px; |
| } |
| </style> |
| </head> |
| <body style="width: 2000px"> |
| |
| <button class="bigbutton">One</button> |
| <button class="bigbutton">Two</button> |
| <button class="bigbutton">Three</button> |
| |
| <div id="console"></div> |
| <script> |
| |
| description("This test ensures that scrolling the window sends a notification."); |
| window.jsTestIsAsync = true; |
| |
| if (window.testRunner && window.accessibilityController) { |
| testRunner.dumpAsText(); |
| |
| window.scrollTo(0, 0); |
| shouldBe("window.pageXOffset", "0"); |
| |
| accessibilityController.addNotificationListener(function (target, notification) { |
| if (target.role == 'AXRole: AXWebArea' && notification == 'ScrollPositionChanged') { |
| debug('Got notification on web area'); |
| accessibilityController.removeNotificationListener(); |
| shouldBe("window.pageXOffset", "500"); |
| finishJSTest(); |
| } |
| }); |
| |
| window.setTimeout(function() { |
| window.scrollTo(500, 0); |
| }, 0); |
| } |
| |
| </script> |
| |
| </body> |
| </html> |