Merge "[Release] Webkit2-efl-123997_0.11.51" into tizen_2.1
[framework/web/webkit-efl.git] / LayoutTests / accessibility / media-element.html
1 <html>
2     <head>
3         <script src="../fast/js/resources/js-test-pre.js"></script>
4         <script>
5             var vidAXObject;
6             var indentLevel = 0;
7
8             if (window.testRunner) {
9                 testRunner.dumpAsText();
10                 testRunner.waitUntilDone();
11             }
12
13             function indent(count)
14             {
15                 var spaces = "                                                      ";
16                 return spaces.substr(0, count);
17             }
18
19             function dumpObject(axObject)
20             {
21                 debug(indent(indentLevel) + "description: " + axObject.description); 
22                 debug(indent(indentLevel) + "role: " + axObject.role); 
23                 debug("<br>");
24             }
25
26             function dumpChildren(axObject)
27             {
28                 var count = axObject.childrenCount
29                 if (!count)
30                     return;
31
32                 indentLevel += 4;
33                 for (var ndx = 0; ndx < count; ndx++) {
34                     var childAXObject = axObject.childAtIndex(ndx);
35                     dumpObject(childAXObject);
36                     if (childAXObject.childrenCount) {
37                         // don't bother dumping static text children
38                         if ( childAXObject.role != "AXRole: AXStaticText")
39                            dumpChildren(childAXObject);
40                     }
41                 }
42                 indentLevel -= 4;
43             }
44
45             function dumpVideoAX()
46             {
47                 debug("<br>+++++++++++++++++++++++++++++++++++<br>");
48                 debug("State at '" + event.type + "' event:<br>");
49
50                 if (!window.accessibilityController)
51                     return;
52
53                 var body = document.getElementsByTagName("body")[0];
54                 body.focus();
55
56                 var vidAXObject = accessibilityController.focusedElement.childAtIndex(0);
57                 
58                 dumpChildren(vidAXObject);
59
60                 if (window.testRunner && event.type == 'canplaythrough')
61                     testRunner.notifyDone();     
62             }
63         </script>
64     </head>
65
66 <body>
67
68     <video id=vid src="../media/content/test.mp4" controls oncanplaythrough="dumpVideoAX()">
69     </video>
70
71     <div>Dump &lt;video&gt; element controller accessibility object tree at 'canplaythrough' event.</div>
72     
73     <div id=console></div>
74
75 </body>
76 </html>
77