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

Unified Diff: LayoutTests/media/avtrack/video-track-selected.html

Issue 284513003: Implement AudioTrack, AudioTrackList, VideoTrack, and VideoTrackList (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nits 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/video-track-selected.html
diff --git a/LayoutTests/media/avtrack/video-track-selected.html b/LayoutTests/media/avtrack/video-track-selected.html
new file mode 100644
index 0000000000000000000000000000000000000000..32254ddac96b8fb63c02aa5d99e83005f247525c
--- /dev/null
+++ b/LayoutTests/media/avtrack/video-track-selected.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+ <head>
+ <title>VideoTrack.selected 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("video");
+ e.src = findMediaFile("video", "../content/test");
+
+ e.onloadedmetadata = t.step_func(function()
+ {
+ assert_equals(e.videoTracks.length, 1, "videoTracks.length");
+ assert_equals(e.videoTracks.selectedIndex, 0, "videoTracks.selectedIndex (initial)");
+ assert_true(e.videoTracks[0].selected, "videoTrack.selected (initial)");
+ e.videoTracks[0].selected = false;
+ assert_equals(e.videoTracks.selectedIndex, -1, "videoTracks.selectedIndex (first setter)");
+ assert_false(e.videoTracks[0].selected, "videoTrack.selected (first setter)");
+
+ e.videoTracks.onchange = t.unreached_func("setting selected to false fired change event");
+ setTimeout(t.step_func(function()
+ {
+ e.videoTracks[0].selected = true;
+ assert_equals(e.videoTracks.selectedIndex, 0, "videoTracks.selectedIndex (second setter)");
+ assert_true(e.videoTracks[0].selected, "videoTrack.selected (second setter)");
+
+ e.videoTracks.onchange = t.step_func(function()
+ {
+ assert_equals(e.videoTracks.selectedIndex, 0, "videoTracks.selectedIndex (change event)");
+ assert_true(e.videoTracks[0].selected, "videoTrack.selected (change event)");
+ t.done();
+ });
+ }), 0);
+ });
+ }, "VideoTrackList track change");
+ </script>
+ </body>
+</html>
« no previous file with comments | « LayoutTests/media/avtrack/getTrackById.html ('k') | LayoutTests/webexposed/global-constructors-listing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698