| 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 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 recorderOnResume = test.step_func(function() { | 36 recorderOnResume = test.step_func(function() { |
| 37 assert_equals(recorder.state, "recording"); | 37 assert_equals(recorder.state, "recording"); |
| 38 recorder.onresume = recorderOnUnexpectedEvent; | 38 recorder.onresume = recorderOnUnexpectedEvent; |
| 39 recorder.onstop = recorderOnStop; | 39 recorder.onstop = recorderOnStop; |
| 40 recorder.stop(); | 40 recorder.stop(); |
| 41 }); | 41 }); |
| 42 | 42 |
| 43 recorderOnPause = test.step_func(function() { | 43 recorderOnPause = test.step_func(function() { |
| 44 assert_equals(recorder.state, "paused"); | 44 assert_equals(recorder.state, "paused"); |
| 45 assert_throws("InvalidStateError", function() { recorder.requestData() }, | |
| 46 "cannot requestData() if recorder is |paused|"); | |
| 47 recorder.onpause = recorderOnUnexpectedEvent; | 45 recorder.onpause = recorderOnUnexpectedEvent; |
| 48 recorder.onresume = recorderOnResume; | 46 recorder.onresume = recorderOnResume; |
| 49 recorder.resume(); | 47 recorder.resume(); |
| 50 }); | 48 }); |
| 51 | 49 |
| 52 recorderOnStart = test.step_func(function() { | 50 recorderOnStart = test.step_func(function() { |
| 53 assert_equals(recorder.state, "recording"); | 51 assert_equals(recorder.state, "recording"); |
| 54 recorder.onstart = recorderOnUnexpectedEvent; | 52 recorder.onstart = recorderOnUnexpectedEvent; |
| 55 recorder.onpause = recorderOnPause; | 53 recorder.onpause = recorderOnPause; |
| 56 recorder.pause(); | 54 recorder.pause(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 86 recorder.ondataavailable = recorderOnDataAvailable; | 84 recorder.ondataavailable = recorderOnDataAvailable; |
| 87 recorder.onstart = recorderOnStart; | 85 recorder.onstart = recorderOnStart; |
| 88 | 86 |
| 89 recorder.start(); | 87 recorder.start(); |
| 90 assert_equals(recorder.state, "recording"); | 88 assert_equals(recorder.state, "recording"); |
| 91 }); | 89 }); |
| 92 | 90 |
| 93 navigator.webkitGetUserMedia({video:true}, gotStream, recorderOnUnexpectedEvent)
; | 91 navigator.webkitGetUserMedia({video:true}, gotStream, recorderOnUnexpectedEvent)
; |
| 94 | 92 |
| 95 </script> | 93 </script> |
| OLD | NEW |