Index: LayoutTests/media/avtrack/audio-track-enabled.html |
diff --git a/LayoutTests/media/avtrack/audio-track-enabled.html b/LayoutTests/media/avtrack/audio-track-enabled.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4932f5014adbfb0a9728bec1aa235e2910001145 |
--- /dev/null |
+++ b/LayoutTests/media/avtrack/audio-track-enabled.html |
@@ -0,0 +1,40 @@ |
+<!doctype html> |
+<html> |
+ <head> |
+ <title>AudioTrack.enabled change</title> |
+ <script src="../../resources/testharness.js"></script> |
+ <script src="../../resources/testharnessreport.js"></script> |
+ <script src="../media-file.js"></script> |
+ </head> |
+ <body> |
+ <div id="log"></div> |
+ <script> |
+ async_test(function(t) |
+ { |
+ var e = document.createElement("audio"); |
+ e.src = findMediaFile("audio", "../content/test"); |
+ |
+ e.onloadedmetadata = t.step_func(function() |
+ { |
+ assert_equals(e.audioTracks.length, 1, "audioTracks.length"); |
+ assert_true(e.audioTracks[0].enabled, "audioTrack.enabled (initial)"); |
+ e.audioTracks[0].enabled = false; |
+ assert_false(e.audioTracks[0].enabled, "audioTrack.enabled (first setter)"); |
+ |
+ e.audioTracks.onchange = t.step_func(function() |
+ { |
+ assert_false(e.audioTracks[0].enabled, "audioTrack.enabled (first change event)"); |
+ e.audioTracks[0].enabled = true; |
+ assert_true(e.audioTracks[0].enabled, "audioTrack.enabled (second setter)"); |
+ |
+ e.audioTracks.onchange = t.step_func(function() |
+ { |
+ assert_true(e.audioTracks[0].enabled, "audioTrack.enabled (second change event)"); |
+ t.done(); |
+ }); |
+ }); |
+ }); |
+ }, "AudioTrack.enabled = false"); |
+ </script> |
+ </body> |
+</html> |