Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: LayoutTests/media/avtrack/getTrackById.html

Issue 284513003: Implement AudioTrack, AudioTrackList, VideoTrack, and VideoTrackList (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: global-constructors-listing-expected Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/media/avtrack/getTrackById.html
diff --git a/LayoutTests/media/avtrack/getTrackById.html b/LayoutTests/media/avtrack/getTrackById.html
new file mode 100644
index 0000000000000000000000000000000000000000..229a6eb82a366f16f67e78d72031bade36e354c2
--- /dev/null
+++ b/LayoutTests/media/avtrack/getTrackById.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>AudioTrackList &amp; VideoTrackList.getTrackById</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('video');
+ e.src = findMediaFile('video', '../content/test');
+
+ e.addEventListener('loadedmetadata', t.step_func(function()
+ {
+ assert_equals(e.audioTracks.length, 1);
+ assert_equals(e.audioTracks.getTrackById(e.audioTracks[0].id), e.audioTracks[0]);
+ assert_equals(e.audioTracks.getTrackById('fake-id'), null);
acolwell GONE FROM CHROMIUM 2014/06/13 17:43:57 nit: Test when lists are empty too?
philipj_slow 2014/06/14 13:51:03 Done.
+
+ assert_equals(e.videoTracks.length, 1);
+ assert_equals(e.videoTracks.getTrackById(e.videoTracks[0].id), e.videoTracks[0]);
+ assert_equals(e.videoTracks.getTrackById('fake-id'), null);
+
+ t.done();
+ }));
+ });
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698