dmazzoni@google.com | 56a8282 | 2012-08-30 02:14:44 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML> |
| 2 | <html> |
| 3 | <body> |
mark.lam@apple.com | a931ab2 | 2013-09-08 01:18:24 +0000 | [diff] [blame] | 4 | <script src="../resources/js-test-pre.js"></script> |
dmazzoni@google.com | 56a8282 | 2012-08-30 02:14:44 +0000 | [diff] [blame] | 5 | |
| 6 | <style>canvas { display: inline; border: 1px solid #000; }</style> |
| 7 | <!-- No whitespace between canvases on purpose, so there's the same |
| 8 | number of children of the container element on all platforms. --> |
| 9 | <div id="container" tabIndex=0 aria-label="Container"><canvas id="canvas1" width="100" height="100" aria-label="Canvas label">Fallback text</canvas><canvas id="canvas2" width="100" height="100"><button>Inner button</button></canvas><canvas id="canvas3-skipped" width="100" height="100"></canvas></div> |
| 10 | |
| 11 | <div id="console"></div> |
| 12 | <script> |
| 13 | description("This test makes sure that a canvas with and without fallback content each has the right role and description.") |
| 14 | |
| 15 | if (window.testRunner && window.accessibilityController) { |
| 16 | window.testRunner.dumpAsText(); |
| 17 | |
| 18 | document.getElementById('container').focus(); |
| 19 | var axContainer = accessibilityController.focusedElement; |
| 20 | |
| 21 | shouldBe("axContainer.childrenCount", "2"); |
| 22 | |
| 23 | var axCanvas1 = axContainer.childAtIndex(0); |
| 24 | debug('Canvas 1 description: ' + axCanvas1.description); |
| 25 | debug('Canvas 1 role: ' + axCanvas1.role); |
| 26 | |
| 27 | var axCanvas2 = axContainer.childAtIndex(1); |
| 28 | debug('Canvas 2 description: ' + axCanvas2.description); |
| 29 | debug('Canvas 2 role: ' + axCanvas2.role); |
| 30 | } |
| 31 | |
| 32 | </script> |
| 33 | |
mark.lam@apple.com | a931ab2 | 2013-09-08 01:18:24 +0000 | [diff] [blame] | 34 | <script src="../resources/js-test-post.js"></script> |
dmazzoni@google.com | 56a8282 | 2012-08-30 02:14:44 +0000 | [diff] [blame] | 35 | </body> |
| 36 | </html> |