Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / accessibility / accessibility-object-detached.html
blobd75184dcc04c6d5b35b460bbd505fd1e25b7dc79
1 <!DOCTYPE HTML>
2 <html>
3 <body>
4 <script src="../resources/js-test.js"></script>
6 <canvas id="canvas"></canvas>
8 <div id="console"></div>
9 <script>
10 description("This test makes sure that AccessibilityObjects are detached when the node they point to is detached.");
12 if (window.testRunner && window.accessibilityController) {
13 window.testRunner.dumpAsText();
15 // Create a button on the page, focus it and get its accessibility role.
16 var button = document.createElement('button');
17 document.body.appendChild(button);
18 button.focus();
19 window.axElement = accessibilityController.focusedElement;
20 window.expectedButtonRole = axElement.role;
22 // Now remove the node from the tree and get the role of the detached accessibility object.
23 // We detect that it's detached just by checking that the role is different (empty or unknown).
24 document.body.removeChild(button);
25 window.expectedDetachedRole = axElement.role;
26 shouldBeTrue("expectedButtonRole != expectedDetachedRole");
29 </script>
31 </body>
32 </html>