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

Side by Side Diff: LayoutTests/imported/web-platform-tests/mediacapture-streams/mediastreams-as-media-elements/video-assignment-manual.html

Issue 560893005: First checked-in import of the W3C's test suites. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add new expectations for newly failing w3c tests Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <title>Assigning mediastream to a video element</title>
5 <link rel="author" title="Dominique Hazael-Massieux" href="mailto:dom@w3.org"/>
6 <link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#na vigatorusermedia">
7 <link rel='stylesheet' href='../../../../resources/testharness.css' media='all'/ >
8 </head>
9 <body>
10 <p class="instructions" style="display:none">When prompted, accept to share your video stream.</p>
11 <h1 class="instructions" style="display:none">Description</h1>
12 <p class="instructions" style="display:none">This test checks that the MediaStre am object returned by
13 the success callback in getUserMedia can be properly assigned to a video element
14 via the <code>srcObject</code> attribute.</p>
15
16 <video id="vid"></video>
17
18 <div id='log'></div>
19 <script src=../../../../resources/testharness.js></script>
20 <script src=../../../../resources/testharnessreport.js></script>
21 <script src="../../../../resources/vendor-prefix.js" data-prefixed-objects='[{"a ncestors":["navigator"], "name":"getUserMedia"}]' data-prefixed-prototypes='[{"a ncestors":["HTMLMediaElement"],"name":"srcObject"}]'></script>
22 <script>
23 var vid = document.getElementById("vid");
24 var t = async_test("Tests that a MediaStream can be assigned to a video element with srcObject", {timeout: 10000});
25 t.step(function() {
26 navigator.getUserMedia({video: true}, t.step_func(function (stream) {
27 var testOncePlaying = function() {
28 assert_equals(vid.played.length, 1, "A MediaStream's timeline always cons ists of a single range");
29 assert_equals(vid.played.start(0), 0, "A MediaStream's timeline always co nsists of a single range");
30 assert_equals(vid.played.end(0), vid.currentTime, "A MediaStream's timeli ne always consists of a single range");
31 assert_equals(vid.readyState, vid.HAVE_ENOUGH_DATA, "Upon selecting a med ia stream, the UA sets readyState to HAVE_ENOUGH_DATA");
32 var time = vid.currentTime;
33 assert_throws("INVALID_STATE_ERR", function() {
34 vid.currentTime = 0;
35 });
36 assert_equals(vid.currentTime, time, "The UA MUST ignore attempts to set the currentTime attribute");
37 // TODO add test that duration must be set to currentTime
38 // when mediastream is destroyed
39 vid.removeEventListener("timeupdate", testOncePlaying, false);
40 t.done();
41 }
42 vid.addEventListener("timeupdate", t.step_func(testOncePlaying), false);
43 vid.srcObject = stream;
44 vid.play();
45 assert_true(!vid.seeking, "A MediaStream is not seekable");
46 assert_equals(vid.seekable.length, 0, "A MediaStream is not seekable");
47 assert_equals(vid.defaultPlaybackRate, 1, "playback rate is always 1");
48 assert_equals(vid.playbackRate, 1, "playback rate is always 1");
49 assert_equals(vid.buffered.length, 0, "A MediaStream cannot be preloaded. T herefore, there is no buffered timeranges");
50 assert_equals(vid.duration, Infinity, " A MediaStream does not have a pre-de fined duration. ");
51 assert_equals(vid.startDate, NaN, " A MediaStream does not specify a timelin e offset");
52 }), function(error) {});
53 });
54 </script>
55 </body>
56 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698