Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / accessibility / media-element.html
1 <!-- webkit-test-runner [ enableModernMediaControls=false ] -->
2 <html>
3     <head>
4         <script src="../resources/js-test-pre.js"></script>
5         <script>
6             var vidAXObject;
7             var indentLevel = 0;
8
9             jsTestIsAsync = true;
10
11             function indent(count)
12             {
13                 var spaces = "                                                      ";
14                 return spaces.substr(0, count);
15             }
16
17             function dumpObject(axObject)
18             {
19             if (accessibilityController.platformName == "atk")
20                 debug(indent(indentLevel) + "title: " + axObject.title);
21             else
22                 debug(indent(indentLevel) + "description: " + axObject.description);
23                 debug(indent(indentLevel) + "role: " + axObject.role); 
24                 if (axObject.subrole && axObject.subrole != 'AXSubrole: ') debug(indent(indentLevel) + "subrole: " + axObject.subrole);
25                 debug("<br>");
26             }
27
28             function dumpChildren(axObject)
29             {
30                 var count = axObject.childrenCount
31                 if (!count)
32                     return;
33
34                 indentLevel += 4;
35                 for (var ndx = 0; ndx < count; ndx++) {
36                     var childAXObject = axObject.childAtIndex(ndx);
37                     dumpObject(childAXObject);
38                     if (childAXObject.childrenCount) {
39                         // don't bother dumping static text children
40                         if ( childAXObject.role != "AXRole: AXStaticText")
41                            dumpChildren(childAXObject);
42                     }
43                 }
44                 indentLevel -= 4;
45             }
46
47             function dumpVideoAX()
48             {
49                 debug("<br>+++++++++++++++++++++++++++++++++++<br>");
50                 debug("State at '" + event.type + "' event:<br>");
51
52                 if (!window.accessibilityController)
53                     return;
54
55                 var body = document.getElementsByTagName("body")[0];
56                 body.focus();
57
58                 var vidAXObject = accessibilityController.focusedElement.childAtIndex(0);
59                 
60                 dumpChildren(vidAXObject);
61
62                 if (event.type == 'canplaythrough')
63                     finishJSTest();
64             }
65         </script>
66     </head>
67
68 <body>
69
70     <video id=vid src="../media/content/test.mp4" controls oncanplaythrough="dumpVideoAX()">
71     </video>
72
73     <div>Dump &lt;video&gt; element controller accessibility object tree at 'canplaythrough' event.</div>
74     
75     <div id=console></div>
76
77     <script src="../resources/js-test-post.js"></script>
78 </body>
79 </html>
80