OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <head> |
| 3 <title>Accessibility: slow document load</title> |
| 4 <script src="/js-test-resources/js-test.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 |
| 8 <div id="console"></div> |
| 9 |
| 10 <script> |
| 11 description("This tests that accessibility events will be fired after the first
layout, rather than only after the document loads."); |
| 12 window.jsTestIsAsync = true; |
| 13 |
| 14 if (window.testRunner && window.accessibilityController) { |
| 15 testRunner.dumpAsText(); |
| 16 |
| 17 startTime = new Date(); |
| 18 gotLayoutCompleteBeforeOneSecond = false; |
| 19 |
| 20 accessibilityController.addNotificationListener(function (target, notificati
on) { |
| 21 elapsedTime = new Date() - startTime; |
| 22 if (notification == "LayoutComplete" && elapsedTime < 1000) { |
| 23 gotLayoutCompleteBeforeOneSecond = true; |
| 24 } |
| 25 |
| 26 if (notification == "LoadComplete") { |
| 27 accessibilityController.removeNotificationListener(); |
| 28 shouldBeGreaterThanOrEqual("elapsedTime", "1000"); |
| 29 shouldBeTrue("gotLayoutCompleteBeforeOneSecond"); |
| 30 finishJSTest(); |
| 31 } |
| 32 }); |
| 33 } |
| 34 </script> |
| 35 |
| 36 <!-- This is a cgi script that waits 1 second before loading. --> |
| 37 <script src="slow-loading-script.cgi"></script> |
| 38 |
| 39 </body> |
| 40 </html> |
OLD | NEW |