blob: 5b8ecd903bdfa7b5ee3d23ec0e2c83fcb6c7ce5a [file] [log] [blame]
dmazzoni@google.com56a82822012-08-30 02:14:44 +00001<!DOCTYPE HTML>
2<html>
3<body>
mark.lam@apple.coma931ab22013-09-08 01:18:24 +00004<script src="../resources/js-test-pre.js"></script>
dmazzoni@google.com56a82822012-08-30 02:14:44 +00005
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>
13description("This test makes sure that a canvas with and without fallback content each has the right role and description.")
14
15if (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.coma931ab22013-09-08 01:18:24 +000034<script src="../resources/js-test-post.js"></script>
dmazzoni@google.com56a82822012-08-30 02:14:44 +000035</body>
36</html>