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

Side by Side Diff: content/test/data/media/getusermedia.html

Issue 2922733002: Propagate muted state from MediaStreamAudioSource into JS. (Closed)
Patch Set: Made SetMuted call unconditional. Rebased. Created 3 years, 5 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 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript" src="webrtc_test_utilities.js"></script> 3 <script type="text/javascript" src="webrtc_test_utilities.js"></script>
4 <script type="text/javascript"> 4 <script type="text/javascript">
5 $ = function(id) { 5 $ = function(id) {
6 return document.getElementById(id); 6 return document.getElementById(id);
7 }; 7 };
8 8
9 setAllEventsOccuredHandler(function() { 9 setAllEventsOccuredHandler(function() {
10 reportTestSuccess(); 10 reportTestSuccess();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // Requests getusermedia and expects it to fail. The error name is returned 56 // Requests getusermedia and expects it to fail. The error name is returned
57 // to the test. 57 // to the test.
58 function getUserMediaAndExpectFailure(constraints) { 58 function getUserMediaAndExpectFailure(constraints) {
59 console.log('Calling getUserMediaAndExpectFailure.'); 59 console.log('Calling getUserMediaAndExpectFailure.');
60 navigator.webkitGetUserMedia( 60 navigator.webkitGetUserMedia(
61 constraints, 61 constraints,
62 function(stream) { failTest('Unexpectedly succeeded getUserMedia.'); }, 62 function(stream) { failTest('Unexpectedly succeeded getUserMedia.'); },
63 function(error) { sendValueToTest(error.name); }); 63 function(error) { sendValueToTest(error.name); });
64 } 64 }
65 65
66 // Requests getusermedia and sets it up to test audio muting callbacks.
67 function getUserMediaForAudioMutingTest(initial_muted_state) {
68 console.log('Calling getUserMediaForAudioMutingTest.');
69 navigator.webkitGetUserMedia(
70 {audio: true},
71 function (stream) {
72 var track = stream.getAudioTracks()[0];
73 track.onmute = function(event) {
74 cancelTestTimeout();
75 sendValueToTest("onmute: muted="+ track.muted.toString() +
76 ", readyState=" + track.readyState);
77 }
78 track.onunmute = function(event) {
79 cancelTestTimeout();
80 sendValueToTest("onunmute: muted="+ track.muted.toString() +
81 ", readyState=" + track.readyState);
82 }
83 if (track.muted == initial_muted_state) {
84 reportTestSuccess();
85 } else {
86 failTest("Expected track.muted to be: " + initial_muted_state +
87 ", was: " + track.muted);
88 }
89 },
90 failedCallback);
91 }
92
66 function renderClonedMediastreamAndStop(constraints, waitTimeInSeconds) { 93 function renderClonedMediastreamAndStop(constraints, waitTimeInSeconds) {
67 console.log('Calling renderClonedMediastreamAndStop.'); 94 console.log('Calling renderClonedMediastreamAndStop.');
68 navigator.webkitGetUserMedia( 95 navigator.webkitGetUserMedia(
69 constraints, 96 constraints,
70 function(stream) { 97 function(stream) {
71 var duplicate = stream.clone(); 98 var duplicate = stream.clone();
72 assertEquals(stream.getVideoTracks().length, 1); 99 assertEquals(stream.getVideoTracks().length, 1);
73 assertEquals(duplicate.getVideoTracks().length, 1); 100 assertEquals(duplicate.getVideoTracks().length, 1);
74 assertNotEquals(stream.getVideoTracks()[0].id, 101 assertNotEquals(stream.getVideoTracks()[0].id,
75 duplicate.getVideoTracks()[0].id); 102 duplicate.getVideoTracks()[0].id);
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 </tr> 569 </tr>
543 <tr> 570 <tr>
544 <td><video id="local-view-2" width="320" height="240" autoplay 571 <td><video id="local-view-2" width="320" height="240" autoplay
545 style="display:none"></video></td> 572 style="display:none"></video></td>
546 <td><canvas id="local-view-2-canvas" width="320" height="240" 573 <td><canvas id="local-view-2-canvas" width="320" height="240"
547 style="display:none"></canvas></td> 574 style="display:none"></canvas></td>
548 </tr> 575 </tr>
549 </table> 576 </table>
550 </body> 577 </body>
551 </html> 578 </html>
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_source.cc ('k') | content/test/data/media/webrtc_test_utilities.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698