Commit e291bbc7 authored by philipj@opera.com's avatar philipj@opera.com

Sync TextTrackList.getTrackById IDL with spec and test it

http://whatwg.org/html#texttracklist

The test has also been submitted to web-platform-tests:
https://github.com/w3c/web-platform-tests/pull/1058

Review URL: https://codereview.chromium.org/336523002

git-svn-id: svn://svn.chromium.org/blink/trunk@176089 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 03069c7c
This is a testharness.js-based test.
PASS TextTrackList.getTrackById
Harness: the test ran to completion.
<!doctype html>
<title>TextTrackList.getTrackById</title>
<script src=../../../../../resources/testharness.js></script>
<script src=../../../../../resources/testharnessreport.js></script>
<div id=log></div>
<script>
test(function(){
var video = document.createElement('video');
var track1 = video.addTextTrack('subtitles');
var track2 = video.addTextTrack('subtitles');
assert_equals(track1.id, '');
assert_equals(track2.id, '');
assert_equals(video.textTracks.getTrackById(''), track1);
assert_equals(video.textTracks.getTrackById('fake-id'), null);
});
</script>
...@@ -28,10 +28,9 @@ ...@@ -28,10 +28,9 @@
] interface TextTrackList : EventTarget { ] interface TextTrackList : EventTarget {
readonly attribute unsigned long length; readonly attribute unsigned long length;
getter TextTrack item(unsigned long index); getter TextTrack item(unsigned long index);
TextTrack getTrackById(DOMString id); TextTrack? getTrackById(DOMString id);
attribute EventHandler onaddtrack; attribute EventHandler onaddtrack;
attribute EventHandler onchange; attribute EventHandler onchange;
attribute EventHandler onremovetrack; attribute EventHandler onremovetrack;
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment