Index: LayoutTests/media/track/track-selection-metadata.html |
diff --git a/LayoutTests/media/track/track-selection-metadata.html b/LayoutTests/media/track/track-selection-metadata.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..352cabb77780b06bb1ef2518a47dbda31378eb32 |
--- /dev/null |
+++ b/LayoutTests/media/track/track-selection-metadata.html |
@@ -0,0 +1,32 @@ |
+<!DOCTYPE html> |
+<title>Multiple 'metadata' tracks with 'default'</title> |
+<script src=../../resources/testharness.js></script> |
+<script src=../../resources/testharnessreport.js></script> |
+<video src="../content/test.ogv"> |
+ <track kind="metadata" src="captions-webvtt/tc005-default-styles.vtt" id="t1"> |
+ <track kind="metadata" src="captions-webvtt/tc025-class.vtt" default id="t2hidden"> |
+ <track kind="metadata" src="captions-webvtt/tc005-metadata-area.vtt" id="t3"> |
+ <track kind="metadata" src="captions-webvtt/tc004-webvtt-file.vtt" default id="t4hidden"> |
+</video> |
+<script> |
+async_test(function() { |
+ var video = document.querySelector('video'); |
+ video.onloadstart = this.step_func(function() { |
+ var tracks = video.textTracks; |
+ assert_equals(tracks.length, 4); |
+ for (var i = 0; i < tracks.length; ++i) { |
+ assert_equals(tracks[i].kind, 'metadata'); |
+ |
+ var trackElement = document.getElementById(tracks[i].id); |
+ if (tracks[i].id.indexOf('hidden') != -1) { |
+ assert_true(trackElement.default); |
+ assert_equals(tracks[i].mode, 'hidden'); |
+ } else { |
+ assert_false(trackElement.default); |
+ assert_equals(tracks[i].mode, 'disabled'); |
+ } |
+ } |
+ this.done(); |
+ }); |
+}); |
+</script> |