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

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-move-to-new-document-srcobject.html

Issue 1815033003: Add srcObject attribute of type MediaStream to HTMLMediaElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: philipj's comments Created 4 years, 8 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Verify that moving a video element to a new document, still loads it norm ally</title> 2 <title>Verify that moving a video element to a new document, still loads it norm ally</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <script src="media-file.js"></script> 5 <script src="media-file.js"></script>
6 <video></video> 6 <video></video>
7 <iframe></iframe> 7 <iframe></iframe>
8 <script> 8 <script>
9 async_test(function(t) { 9 async_test(function(t) {
10 var video = document.querySelector('video'); 10 var video = document.querySelector('video');
11 video.src = findMediaFile("video", "content/test"); 11 navigator.webkitGetUserMedia(
12 {video:true},
13 t.step_func(stream => video.srcObject = stream),
14 t.unreached_func("Did not get mediastream"));
12 video.onloadeddata = this.step_func(function() { 15 video.onloadeddata = this.step_func(function() {
13 video.onloadeddata = null; 16 video.onloadeddata = null;
14 assert_true(video.networkState == video.NETWORK_IDLE || video.networ kState == video.NETWORK_LOADING); 17 assert_true(video.networkState == video.NETWORK_IDLE || video.networ kState == video.NETWORK_LOADING);
15 assert_greater_than(video.readyState, video.HAVE_METADATA); 18 assert_greater_than(video.readyState, video.HAVE_METADATA);
16 // Move the video element to iframe document from 19 // Move the video element to iframe document from
17 // main document and verify that it loads properly 20 // main document and verify that it loads properly
18 document.querySelector('iframe').contentDocument.body.appendChild(vi deo); 21 document.querySelector('iframe').contentDocument.body.appendChild(vi deo);
19 assert_equals(video.networkState, video.NETWORK_NO_SOURCE); 22 assert_equals(video.networkState, video.NETWORK_NO_SOURCE);
20 assert_equals(video.readyState, video.HAVE_NOTHING); 23 assert_equals(video.readyState, video.HAVE_NOTHING);
21 var actual_events = []; 24 var actual_events = [];
22 var expected_events = ['emptied', 'loadstart', 'loadeddata']; 25 var expected_events = ['emptied', 'loadstart', 'loadeddata'];
23 expected_events.forEach(function(type) { 26 expected_events.forEach(function(type) {
24 video.addEventListener(type, t.step_func(function() { 27 video.addEventListener(type, t.step_func(function() {
25 actual_events.push(type); 28 actual_events.push(type);
26 if (type == 'loadeddata') { 29 if (type == 'loadeddata') {
27 assert_array_equals(actual_events, expected_events); 30 assert_array_equals(actual_events, expected_events);
28 t.done(); 31 t.done();
29 } 32 }
30 })); 33 }));
31 }); 34 });
32 }); 35 });
33 }); 36 });
34 </script> 37 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698