1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <p>This tests that a media element ie:
<code><Audio
></code> or
<code><video
></code>, without tabindex can be selected with keyboard (TAB Key)
</p>
5 <pre id=
"console"></pre>
7 <input id=
"WithTabIndexVideo" type=text
>
9 <video id=
"video1" onfocus=
"window.mediaFocused = true" controls
tabindex=
"0" src=
"../media/content/test.mp4"></video>
12 <input id=
"WithoutTabIndexVideo" type=text
>
14 <video id=
"video2" onfocus=
"window.mediaFocused = true" controls
src=
"../media/content/test.mp4"></video>
17 <input id=
"WithoutControlsButWithTabIndexVideo" type=text
>
19 <video id=
"video3" onfocus=
"window.mediaFocused = true" tabindex=
"0" src=
"../media/content/test.mp4"></video>
22 <input id=
"WithoutTabIndexAudio" type=text
>
24 <audio id=
"audio1" onfocus=
"window.mediaFocused = true" controls
src=
"../media/content/test.wav"></audio>
27 <input id=
"WithoutControlaAndTabIndexAudio" type=text
>
29 <audio id=
"audio2" onfocus=
"window.mediaFocused = true" src=
"../media/content/test.mp4"></audio>
34 if (window
.testRunner
)
35 testRunner
.dumpAsText();
37 function test(mediaId
, fieldId
, shoulbefocussed
)
39 if (!window
.eventSender
)
42 var mediaFocusedResult
, mediaNotFocusedResult
;
45 mediaFocusedResult
= "SUCCESS";
46 mediaNotFocusedResult
= "FAIL";
50 mediaFocusedResult
= "FAIL";
51 mediaNotFocusedResult
= "SUCCESS";
54 window
.mediaFocused
= false;
55 document
.getElementById(fieldId
).focus();
56 eventSender
.keyDown('\t');
57 if (window
.mediaFocused
)
58 document
.getElementById("console").innerHTML
+= mediaFocusedResult
+ ": Tab-Key did tab to the Media Element (" + mediaId
+ "). TEST: " + fieldId
+ ".\n";
60 document
.getElementById("console").innerHTML
+= mediaNotFocusedResult
+ ": Tab-Key did not tab to the Media Element (" + mediaId
+ "). TEST: " + fieldId
+ ".\n";
63 test("video1", "WithTabIndexVideo", true);
64 test("video2", "WithoutTabIndexVideo", true);
65 test("video3", "WithoutControlsButWithTabIndexVideo", true);
66 test("audio1", "WithoutTabIndexAudio", "SUCCESS", true);
67 test("audio2", "WithoutControlaAndTabIndexAudio", false);