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

Side by Side Diff: LayoutTests/fast/mediarecorder/MediaRecorder-basic-video.html

Issue 1319473016: MediaRecorder: disabling LayoutTests in preparation of Cr CLs and a minor update (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Marking MR layout tests as Skip Created 5 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src=../../resources/testharness.js></script> 2 <script src=../../resources/testharness.js></script>
3 <script src=../../resources/testharnessreport.js></script> 3 <script src=../../resources/testharnessreport.js></script>
4 <script> 4 <script>
5 5
6 var test = async_test('checks the video-only MediaRecorder API.'); 6 var test = async_test('checks the video-only MediaRecorder API.');
7 7
8 recorderOnDataAvailable = test.step_func(function(event) { 8 recorderOnDataAvailable = test.step_func(function(event) {
9 assert_greater_than(event.data.size, 0, 'Recorded data size should be > 0'); 9 assert_greater_than(event.data.size, 0, 'Recorded data size should be > 0');
10 assert_eq(recorder.state, "recording"); 10 assert_equals(recorder.state, "recording");
11 11
12 // TODO(mcasas): Let the test record for a while. 12 // TODO(mcasas): Let the test record for a while.
13 // TODO(mcasas): Consider storing the recorded data and playing it back. 13 // TODO(mcasas): Consider storing the recorded data and playing it back.
14 14
15 test.done(); 15 test.done();
16 }); 16 });
17 17
18 recorderOnStop = test.step_func(function() { 18 recorderOnStop = test.step_func(function() {
19 assert_unreached('Recording stopped.'); 19 assert_unreached('Recording stopped.');
20 }); 20 });
21 21
22 gotStream = test.step_func(function(s) { 22 gotStream = test.step_func(function(s) {
23 stream = s; 23 stream = s;
24 assert_equals(stream.getAudioTracks().length, 0); 24 assert_equals(stream.getAudioTracks().length, 0);
25 assert_equals(stream.getVideoTracks().length, 1); 25 assert_equals(stream.getVideoTracks().length, 1);
26 assert_equals(stream.getVideoTracks()[0].readyState, 'live');
26 27
27 try { 28 try {
28 recorder = new MediaRecorder(stream); 29 recorder = new MediaRecorder(stream);
29 } catch (e) { 30 } catch (e) {
30 assert_unreached('Exception while creating MediaRecorder: ' + e); 31 assert_unreached('Exception while creating MediaRecorder: ' + e);
31 } 32 }
32 33
33 assert_eq(recorder.state, "inactive"); 34 assert_equals(recorder.state, "inactive");
34 recorder.ondataavailable = recorderOnDataAvailable; 35 recorder.ondataavailable = recorderOnDataAvailable;
35 recorder.onstop = recorderOnStop; 36 recorder.onstop = recorderOnStop;
36 recorder.start(); 37 recorder.start();
38
39 assert_equals(recorder.state, "recording");
40 test.done();
37 }); 41 });
38 42
39 onError = test.step_func(function() { 43 onError = test.step_func(function() {
40 assert_unreached('Error creating MediaRecorder.'); 44 assert_unreached('Error creating MediaRecorder.');
41 }); 45 });
42 46
43 try { 47 try {
44 navigator.webkitGetUserMedia({video:true}, gotStream, onError); 48 navigator.webkitGetUserMedia({video:true}, gotStream, onError);
45 } catch(e) { 49 } catch(e) {
46 assert_unreached('Exception launching getUserMedia(): ' + e); 50 assert_unreached('Exception launching getUserMedia(): ' + e);
47 } 51 }
48 52
49 </script> 53 </script>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/mediarecorder/MediaRecorder-canRecordMimeType.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698