2009-04-20 00:09:21 -07:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=483573
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>HTML5 audio/video tests</title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
|
|
|
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/MochiKit/packed.js"></script>
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
|
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="common.js"></script>
|
2009-05-10 18:32:09 -07:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="events.js"></script>
|
2009-05-10 18:32:09 -07:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="actions.js"></script>
|
2009-04-20 00:09:21 -07:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="role.js"></script>
|
2009-05-22 09:09:51 -07:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="states.js"></script>
|
2009-04-20 00:09:21 -07:00
|
|
|
|
|
|
|
<script type="application/javascript">
|
2009-05-10 18:32:09 -07:00
|
|
|
|
2009-05-22 09:09:51 -07:00
|
|
|
// gA11yEventDumpID = "eventDump";
|
|
|
|
|
2009-05-13 22:27:40 -07:00
|
|
|
function focusChecker(aAcc)
|
2009-05-10 18:32:09 -07:00
|
|
|
{
|
|
|
|
this.type = EVENT_FOCUS;
|
|
|
|
this.target = aAcc;
|
|
|
|
this.getID = function focusChecker_getID()
|
|
|
|
{
|
|
|
|
return "focus handling";
|
2009-05-13 22:27:40 -07:00
|
|
|
}
|
2009-05-22 09:09:51 -07:00
|
|
|
this.check = function focusChecker_check(aEvent)
|
|
|
|
{
|
|
|
|
testStates(this.target, STATE_FOCUSED);
|
|
|
|
}
|
2009-05-13 22:27:40 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function nameChecker(aAcc, aName)
|
|
|
|
{
|
|
|
|
this.type = EVENT_NAME_CHANGE;
|
|
|
|
this.target = aAcc;
|
|
|
|
this.getID = function nameChecker_getID()
|
|
|
|
{
|
|
|
|
return "name change handling";
|
2009-05-10 18:32:09 -07:00
|
|
|
},
|
2009-05-22 09:09:51 -07:00
|
|
|
this.check = function nameChecker_check(aEvent)
|
2009-05-10 18:32:09 -07:00
|
|
|
{
|
2009-05-13 22:27:40 -07:00
|
|
|
is(aEvent.accessible.name, aName,
|
|
|
|
"Wrong name of " + prettyName(aEvent.accessible) + " on focus");
|
2009-05-10 18:32:09 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-04-20 00:09:21 -07:00
|
|
|
function doTest()
|
|
|
|
{
|
2009-05-10 18:32:09 -07:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// test the accessible tree
|
|
|
|
|
2009-04-20 00:09:21 -07:00
|
|
|
var accTree = {
|
|
|
|
role: ROLE_GROUPING,
|
|
|
|
children: [
|
|
|
|
{ // start/stop button
|
2009-05-10 18:32:09 -07:00
|
|
|
role: ROLE_PUSHBUTTON,
|
2009-05-22 09:09:51 -07:00
|
|
|
name: "Play",
|
|
|
|
states: {
|
|
|
|
states: STATE_FOCUSABLE
|
|
|
|
}
|
2009-04-20 00:09:21 -07:00
|
|
|
},
|
|
|
|
{ // buffer bar
|
|
|
|
role: ROLE_PROGRESSBAR
|
|
|
|
},
|
|
|
|
{ // progress bar
|
|
|
|
role: ROLE_PROGRESSBAR
|
|
|
|
},
|
2009-05-11 08:20:03 -07:00
|
|
|
{ // slider of progress bar
|
2009-05-13 22:29:33 -07:00
|
|
|
role: ROLE_SLIDER,
|
2009-05-22 09:09:51 -07:00
|
|
|
name: "0:00 of 0:01 elapsed",
|
|
|
|
states: {
|
|
|
|
states: STATE_FOCUSABLE
|
|
|
|
}
|
2009-04-20 00:09:21 -07:00
|
|
|
},
|
2009-05-13 22:29:33 -07:00
|
|
|
{ // duration label, role="presentation"
|
|
|
|
role: ROLE_NOTHING
|
2009-04-23 09:59:43 -07:00
|
|
|
},
|
|
|
|
{ // mute button
|
2009-05-10 18:32:09 -07:00
|
|
|
role: ROLE_PUSHBUTTON,
|
2009-05-22 09:09:51 -07:00
|
|
|
name: "Mute",
|
|
|
|
states: {
|
|
|
|
states: STATE_FOCUSABLE
|
|
|
|
}
|
2009-04-20 00:09:21 -07:00
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
testAccessibleTree("audio", accTree);
|
|
|
|
|
2009-05-10 18:32:09 -07:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// test actions of audio controls
|
|
|
|
|
|
|
|
var audioElm = getAccessible("audio");
|
|
|
|
var playBtn = audioElm.firstChild;
|
2009-05-22 09:09:51 -07:00
|
|
|
var scrubber = playBtn.nextSibling.nextSibling.nextSibling;
|
2009-05-10 18:32:09 -07:00
|
|
|
var muteBtn = audioElm.lastChild;
|
|
|
|
|
|
|
|
var actions = [
|
|
|
|
{
|
2009-05-13 22:27:40 -07:00
|
|
|
ID: muteBtn,
|
2009-05-10 18:32:09 -07:00
|
|
|
actionName: "press",
|
|
|
|
events: CLICK_EVENTS,
|
2009-05-13 22:27:40 -07:00
|
|
|
eventSeq: [
|
|
|
|
new focusChecker(muteBtn),
|
|
|
|
new nameChecker(muteBtn, "Unmute"),
|
|
|
|
]
|
2009-05-10 18:32:09 -07:00
|
|
|
},
|
2009-05-22 09:09:51 -07:00
|
|
|
{
|
|
|
|
ID: scrubber,
|
|
|
|
actionName: "activate",
|
|
|
|
events: null,
|
|
|
|
eventSeq: [
|
|
|
|
new focusChecker(scrubber)
|
|
|
|
]
|
|
|
|
},
|
2009-05-10 18:32:09 -07:00
|
|
|
{
|
2009-05-13 22:27:40 -07:00
|
|
|
ID: playBtn,
|
2009-05-10 18:32:09 -07:00
|
|
|
actionName: "press",
|
|
|
|
events: CLICK_EVENTS,
|
2009-05-13 22:27:40 -07:00
|
|
|
eventSeq: [
|
|
|
|
new focusChecker(playBtn),
|
|
|
|
new nameChecker(playBtn, "Pause"),
|
|
|
|
]
|
2009-05-10 18:32:09 -07:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
testActions(actions); // Will call SimpleTest.finish();
|
2009-04-20 00:09:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2009-05-10 18:32:09 -07:00
|
|
|
addA11yLoadEvent(doTest);
|
2009-04-20 00:09:21 -07:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<a target="_blank"
|
|
|
|
title="Expose HTML5 video and audio elements' embedded controls through accessibility APIs"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=483573">Mozilla Bug 483573</a>
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none"></div>
|
|
|
|
<pre id="test">
|
|
|
|
</pre>
|
|
|
|
|
2010-09-01 15:09:56 -07:00
|
|
|
<audio id="audio" src="bug461281.ogg"
|
2009-05-10 18:32:09 -07:00
|
|
|
controls="true"></audio>
|
2009-05-22 09:09:51 -07:00
|
|
|
|
|
|
|
<div id="eventDump"></div>
|
2009-04-20 00:09:21 -07:00
|
|
|
</body>
|
|
|
|
</html>
|