Fri, 16 Jan 2015 04:50:19 +0100
Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>Media test: volume attribute set</title> |
michael@0 | 5 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 6 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 7 | </head> |
michael@0 | 8 | <body> |
michael@0 | 9 | |
michael@0 | 10 | <video id='v1'></video><audio id='a1'></audio> |
michael@0 | 11 | |
michael@0 | 12 | <pre id="test"> |
michael@0 | 13 | <script class="testbody" type="text/javascript"> |
michael@0 | 14 | |
michael@0 | 15 | function test(element, value, shouldThrow) { |
michael@0 | 16 | var threw = null; |
michael@0 | 17 | try { |
michael@0 | 18 | element.volume = value; |
michael@0 | 19 | } catch (ex) { |
michael@0 | 20 | threw = ex.name; |
michael@0 | 21 | } |
michael@0 | 22 | is(shouldThrow, threw, "Case: " +element.id+ " setVolume=" + value); |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | |
michael@0 | 26 | var ids = new Array(document.getElementById('v1'), document.getElementById('a1')); |
michael@0 | 27 | |
michael@0 | 28 | for (i=0; i<ids.length; i++) { |
michael@0 | 29 | var element = ids[i]; |
michael@0 | 30 | test(element, 0.0, null); |
michael@0 | 31 | test(element, 1.0, null); |
michael@0 | 32 | test(element, -0.1, "IndexSizeError"); |
michael@0 | 33 | test(element, 1.1, "IndexSizeError"); |
michael@0 | 34 | test(element, undefined, "TypeError"); |
michael@0 | 35 | test(element, NaN, "TypeError"); |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | </script> |
michael@0 | 39 | </pre> |
michael@0 | 40 | </body> |
michael@0 | 41 | </html> |