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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-remotestreams.html

Issue 2446173002: Use RTCPeerConnection instead of webkitRTCPeerConnection (Closed)
Patch Set: rebase Created 4 years, 1 month 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 PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 description("Tests that an RTCPeerConnection can signal that remote streams are added and removed."); 8 description("Tests that an RTCPeerConnection can signal that remote streams are added and removed.");
9 9
10 var pc = null; 10 var pc = null;
(...skipping 10 matching lines...) Expand all
21 } catch (e) { 21 } catch (e) {
22 testFailed('webkitGetUserMedia threw exception :' + e); 22 testFailed('webkitGetUserMedia threw exception :' + e);
23 finishJSTest(); 23 finishJSTest();
24 } 24 }
25 } 25 }
26 26
27 function requestSucceeded2() 27 function requestSucceeded2()
28 { 28 {
29 testPassed('requestSucceeded was called.'); 29 testPassed('requestSucceeded was called.');
30 shouldBeEqualToNumber('pc.getRemoteStreams().length', 0); 30 shouldBeEqualToNumber('pc.getRemoteStreams().length', 0);
31 finishJSTest(); 31 finishJSTest();
32 } 32 }
33 33
34 function requestSucceeded1() 34 function requestSucceeded1()
35 { 35 {
36 testPassed('requestSucceeded was called.'); 36 testPassed('requestSucceeded was called.');
37 shouldBeEqualToNumber('pc.getRemoteStreams().length', 1); 37 shouldBeEqualToNumber('pc.getRemoteStreams().length', 1);
38 38
39 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"}) ; 39 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"}) ;
40 shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded 2, requestFailedUnexpectedly);'); 40 shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded 2, requestFailedUnexpectedly);');
41 } 41 }
(...skipping 24 matching lines...) Expand all
66 pc.removeStream(local_stream); 66 pc.removeStream(local_stream);
67 } 67 }
68 68
69 function onRemoveStream(event) { 69 function onRemoveStream(event) {
70 testPassed('remote stream was removed'); 70 testPassed('remote stream was removed');
71 shouldBeEqualToNumber('event.stream.getVideoTracks().length', 0); 71 shouldBeEqualToNumber('event.stream.getVideoTracks().length', 0);
72 shouldBeEqualToNumber('event.stream.getAudioTracks().length', 0); 72 shouldBeEqualToNumber('event.stream.getAudioTracks().length', 0);
73 shouldBeFalse('event.stream.active') 73 shouldBeFalse('event.stream.active')
74 } 74 }
75 75
76 pc = new webkitRTCPeerConnection(null, null); 76 pc = new RTCPeerConnection();
77 pc.onaddstream = onAddStream; 77 pc.onaddstream = onAddStream;
78 pc.onremovestream = onRemoveStream; 78 pc.onremovestream = onRemoveStream;
79 getUserMedia({audio:true, video:true}, gotStream); 79 getUserMedia({audio:true, video:true}, gotStream);
80 80
81 81
82 window.jsTestIsAsync = true; 82 window.jsTestIsAsync = true;
83 window.successfullyParsed = true; 83 window.successfullyParsed = true;
84 </script> 84 </script>
85 </body> 85 </body>
86 </html> 86 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698