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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer.html

Issue 2097563002: Split the mediastream module in Blink into mediastream and peerconnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Copy OWNERS file from mediastream/ to peerconnection/ Created 4 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
(Empty)
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("Tests RTCPeerConnection createAnswer.");
9
10 var pc = null;
11
12 function unexpectedCallback()
13 {
14 testFailed('unexpectedCallback was called')
15 finishJSTest();
16 }
17
18 function answerCreated()
19 {
20 testPassed('createAnswer request succeeded.');
21 finishJSTest();
22 }
23
24 function descriptionSet()
25 {
26 testPassed('setRemoteDescription request succeeded.');
27 shouldNotThrow('pc.createAnswer(answerCreated, unexpectedCallback);');
28 }
29
30 function createOfferWithoutDescriptionFailed()
31 {
32 testPassed('createOffer request without remote description failed.');
33 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"} );
34 shouldNotThrow('pc.setRemoteDescription(sessionDescription, descriptionSet, unexpectedCallback);');
35 }
36
37 function testExecutionOrderClosedConnection()
38 {
39 var localPeerConnection = new webkitRTCPeerConnection(null, null);
40 localPeerConnection.close();
41 var counter = 0;
42 window.events = [];
43 Promise.resolve().then(_ => window.events[counter++] = 1);
44 localPeerConnection.createAnswer(unexpectedCallback, error => {
45 window.error = error;
46 shouldBe('error.name', '"InvalidStateError"');
47 shouldBe('error.toString()', '"InvalidStateError: The RTCPeerConnection\ 's signalingState is \'closed\'."');
48 window.events[counter++] = 2;
49 });
50 Promise.resolve().then(_ => {
51 window.events[counter++] = 3;
52 shouldBe('events', '[1,2,3]');
53 });
54 }
55
56 shouldNotThrow('testExecutionOrderClosedConnection()');
57 pc = new webkitRTCPeerConnection(null, null);
58 pc.createOffer(unexpectedCallback, createOfferWithoutDescriptionFailed);
59
60 window.jsTestIsAsync = true;
61 window.successfullyParsed = true;
62 </script>
63 </body>
64 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698