3 <title>Accessibility: slow document load
</title>
4 <script src=
"/js-test-resources/js-test.js"></script>
8 <div id=
"console"></div>
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;
14 if (window
.testRunner
&& window
.accessibilityController
) {
15 testRunner
.dumpAsText();
17 startTime
= new Date();
18 gotLayoutCompleteBeforeOneSecond
= false;
20 accessibilityController
.addNotificationListener(function (target
, notification
) {
21 elapsedTime
= new Date() - startTime
;
22 if (notification
== "LayoutComplete" && elapsedTime
< 900) {
23 gotLayoutCompleteBeforeOneSecond
= true;
26 if (notification
== "LoadComplete") {
27 accessibilityController
.removeNotificationListener();
28 shouldBeGreaterThanOrEqual("elapsedTime", "900");
29 shouldBeTrue("gotLayoutCompleteBeforeOneSecond");
35 setTimeout(function() {
36 // Cause an incremental layout.
37 document
.body
.offsetTop
;
41 <!-- This is a cgi script that waits 1 second before loading.
42 In practice, it seems to sometimes load after slightly less
43 time, like 996 ms, so that's why we use 900 ms as the threshold
46 <script src=
"slow-loading-script.cgi"></script>