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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-createOffer.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 RTCPeerConnection createOffer."); 8 description("Tests RTCPeerConnection createOffer.");
9 9
10 // Note: createOffer() calls in the test runner are successful if the 10 // Note: createOffer() calls in the test runner are successful if the
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 function createOfferSucceeded1(sessionDescription) 87 function createOfferSucceeded1(sessionDescription)
88 { 88 {
89 testPassed('createOfferSucceeded1 was called.'); 89 testPassed('createOfferSucceeded1 was called.');
90 window.sessionDescription = sessionDescription; 90 window.sessionDescription = sessionDescription;
91 shouldBe('sessionDescription.type', '"offer"'); 91 shouldBe('sessionDescription.type', '"offer"');
92 shouldNotThrow('pc.createOffer(unexpectedCallback, expectedCreateOfferFailed 1);'); 92 shouldNotThrow('pc.createOffer(unexpectedCallback, expectedCreateOfferFailed 1);');
93 } 93 }
94 94
95 function testExecutionOrderClosedConnection() 95 function testExecutionOrderClosedConnection()
96 { 96 {
97 var localPeerConnection = new webkitRTCPeerConnection(null, null); 97 var localPeerConnection = new RTCPeerConnection();
98 localPeerConnection.close(); 98 localPeerConnection.close();
99 var counter = 0; 99 var counter = 0;
100 window.events = []; 100 window.events = [];
101 Promise.resolve().then(_ => window.events[counter++] = 1); 101 Promise.resolve().then(_ => window.events[counter++] = 1);
102 localPeerConnection.createOffer(unexpectedCallback, error => { 102 localPeerConnection.createOffer(unexpectedCallback, error => {
103 window.error = error; 103 window.error = error;
104 shouldBe('error.name', '"InvalidStateError"'); 104 shouldBe('error.name', '"InvalidStateError"');
105 shouldBe('error.toString()', '"InvalidStateError: The RTCPeerConnection\ 's signalingState is \'closed\'."'); 105 shouldBe('error.toString()', '"InvalidStateError: The RTCPeerConnection\ 's signalingState is \'closed\'."');
106 window.events[counter++] = 2; 106 window.events[counter++] = 2;
107 }); 107 });
108 Promise.resolve().then(_ => { 108 Promise.resolve().then(_ => {
109 window.events[counter++] = 3; 109 window.events[counter++] = 3;
110 shouldBe('events', '[1,2,3]'); 110 shouldBe('events', '[1,2,3]');
111 }); 111 });
112 } 112 }
113 113
114 shouldNotThrow('testExecutionOrderClosedConnection()'); 114 shouldNotThrow('testExecutionOrderClosedConnection()');
115 pc = new webkitRTCPeerConnection(null); 115 pc = new RTCPeerConnection();
116 shouldNotThrow('pc.createOffer(createOfferSucceeded1, unexpectedCallback, {voice ActivityDetection:true, iceRestart:true, offerToReceiveAudio:1, offerToReceiveVi deo:1});'); 116 shouldNotThrow('pc.createOffer(createOfferSucceeded1, unexpectedCallback, {voice ActivityDetection:true, iceRestart:true, offerToReceiveAudio:1, offerToReceiveVi deo:1});');
117 117
118 window.jsTestIsAsync = true; 118 window.jsTestIsAsync = true;
119 window.successfullyParsed = true; 119 window.successfullyParsed = true;
120 </script> 120 </script>
121 </body> 121 </body>
122 </html> 122 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698