| OLD | NEW |
| 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('exercises the MediaRecorder API event chain: ' + | 6 var test = async_test('exercises the MediaRecorder API event chain: ' + |
| 7 'onstart->onpaused->onresumed->onstopped in sequence, and also potential ' + | 7 'onstart->onpaused->onresumed->onstopped in sequence, and also potential ' + |
| 8 'exceptions that are thrown underway.'); | 8 'exceptions that are thrown underway.'); |
| 9 var recorder; | 9 var recorder; |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 recorder.pause(); | 56 recorder.pause(); |
| 57 }); | 57 }); |
| 58 | 58 |
| 59 gotStream = test.step_func(function(stream) { | 59 gotStream = test.step_func(function(stream) { |
| 60 assert_equals(stream.getAudioTracks().length, 0); | 60 assert_equals(stream.getAudioTracks().length, 0); |
| 61 assert_equals(stream.getVideoTracks().length, 1); | 61 assert_equals(stream.getVideoTracks().length, 1); |
| 62 assert_equals(stream.getVideoTracks()[0].readyState, 'live'); | 62 assert_equals(stream.getVideoTracks()[0].readyState, 'live'); |
| 63 | 63 |
| 64 assert_throws("NotSupportedError", | 64 assert_throws("NotSupportedError", |
| 65 function() { | 65 function() { |
| 66 recorder = new MediaRecorder(stream, "video/invalid"); | 66 recorder = new MediaRecorder(stream, {mimeType : "video/in
valid"}); |
| 67 }, | 67 }, |
| 68 "recorder should throw() with unsupported mimeType"); | 68 "recorder should throw() with unsupported mimeType"); |
| 69 | 69 |
| 70 try { | 70 try { |
| 71 recorder = new MediaRecorder(stream); | 71 recorder = new MediaRecorder(stream); |
| 72 } catch (e) { | 72 } catch (e) { |
| 73 assert_unreached('Exception while creating MediaRecorder: ' + e); | 73 assert_unreached('Exception while creating MediaRecorder: ' + e); |
| 74 } | 74 } |
| 75 assert_equals(recorder.state, "inactive"); | 75 assert_equals(recorder.state, "inactive"); |
| 76 | 76 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 94 assert_equals(recorder.state, "recording"); | 94 assert_equals(recorder.state, "recording"); |
| 95 }); | 95 }); |
| 96 | 96 |
| 97 try { | 97 try { |
| 98 navigator.webkitGetUserMedia({video:true}, gotStream, recorderOnUnexpectedEv
ent); | 98 navigator.webkitGetUserMedia({video:true}, gotStream, recorderOnUnexpectedEv
ent); |
| 99 } catch(e) { | 99 } catch(e) { |
| 100 assert_unreached('Exception launching getUserMedia(): ' + e); | 100 assert_unreached('Exception launching getUserMedia(): ' + e); |
| 101 } | 101 } |
| 102 | 102 |
| 103 </script> | 103 </script> |
| OLD | NEW |