4 <title>Media test: volume attribute set
</title>
5 <script type=
"text/javascript" src=
"/MochiKit/MochiKit.js"></script>
6 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
7 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
11 <video id='v1'
></video><audio id='a1'
></audio>
14 <script class=
"testbody" type=
"text/javascript">
16 function test(element, value, shouldThrow) {
19 element.volume = value;
20 } catch (err if err.name ==
"NS_ERROR_DOM_INDEX_SIZE_ERR") {
23 is(shouldThrow, threw,
"Case: " +element.id+
" setVolume=" + value);
27 var ids = new Array(document.getElementById('v1'), document.getElementById('a1'));
29 for (i=
0; i
<ids.length; i++) {
31 test(element,
0.0,false);
32 test(element,
1.0, false);
33 test(element, -
0.1, true);
34 test(element,
1.1, true);