OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <title>AudioTrack.enabled change</title> |
| 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 <script src="../media-file.js"></script> |
| 8 </head> |
| 9 <body> |
| 10 <div id="log"></div> |
| 11 <script> |
| 12 async_test(function(t) |
| 13 { |
| 14 var e = document.createElement("audio"); |
| 15 e.src = findMediaFile("audio", "../content/test"); |
| 16 |
| 17 e.onloadedmetadata = t.step_func(function() |
| 18 { |
| 19 assert_equals(e.audioTracks.length, 1, "audioTracks.length")
; |
| 20 assert_true(e.audioTracks[0].enabled, "audioTrack.enabled (i
nitial)"); |
| 21 e.audioTracks[0].enabled = false; |
| 22 assert_false(e.audioTracks[0].enabled, "audioTrack.enabled (
first setter)"); |
| 23 |
| 24 e.audioTracks.onchange = t.step_func(function() |
| 25 { |
| 26 assert_false(e.audioTracks[0].enabled, "audioTrack.enabl
ed (first change event)"); |
| 27 e.audioTracks[0].enabled = true; |
| 28 assert_true(e.audioTracks[0].enabled, "audioTrack.enable
d (second setter)"); |
| 29 |
| 30 e.audioTracks.onchange = t.step_func(function() |
| 31 { |
| 32 assert_true(e.audioTracks[0].enabled, "audioTrack.en
abled (second change event)"); |
| 33 t.done(); |
| 34 }); |
| 35 }); |
| 36 }); |
| 37 }, "AudioTrack.enabled = false"); |
| 38 </script> |
| 39 </body> |
| 40 </html> |
OLD | NEW |