Skip to content

Commit c91d4f0

Browse files
Guido UrdanetaCommit Bot
Guido Urdaneta
authored and
Commit Bot
committed
[RTCInsertableStreams] Add new test
Add a test for video flow when the negotiation is started by the remote side. Bug: 1065836 Change-Id: I56a89f4977516694c1ac8ab50860d940b1171ba6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2127927 Reviewed-by: Harald Alvestrand <[email protected]> Commit-Queue: Guido Urdaneta <[email protected]> Cr-Commit-Position: refs/heads/master@{#755288}
1 parent f6a9cbb commit c91d4f0

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

third_party/blink/web_tests/fast/peerconnection/RTCPeerConnection-insertable-streams.html

+21-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@
2929
areArrayBuffersEqual(frame1.data, frame2.data);
3030
}
3131

32-
promise_test(async t => {
32+
async function doInverseSignalingHandshake(pc1, pc2) {
33+
const offer = await pc2.createOffer({offerToReceiveAudio: true, offerToReceiveVideo: true});
34+
await pc1.setRemoteDescription(offer);
35+
await pc2.setLocalDescription(offer);
36+
37+
const answer = await pc1.createAnswer();
38+
await pc2.setRemoteDescription(answer);
39+
await pc1.setLocalDescription(answer);
40+
}
41+
42+
async function testVideoFlow(t, negotiationFunction) {
3343
const caller = new RTCPeerConnection({forceEncodedVideoInsertableStreams:true});
3444
t.add_cleanup(() => caller.close());
3545
const callee = new RTCPeerConnection({forceEncodedVideoInsertableStreams:true});
@@ -87,7 +97,8 @@
8797
});
8898

8999
exchangeIceCandidates(caller, callee);
90-
await doSignalingHandshake(caller, callee);
100+
await negotiationFunction(caller, callee);
101+
91102
// Pass frames as they come from the encoder.
92103
for (let i = 0; i < numFramesPassthrough; i++) {
93104
const result = await senderReader.read()
@@ -117,8 +128,16 @@
117128
frameInfos.push({timestamp: result.value.timestamp, data: result.value.data});
118129
senderWriter.write(result.value);
119130
}
131+
}
132+
133+
promise_test(async t => {
134+
return testVideoFlow(t, doSignalingHandshake);
120135
}, 'Frames flow correctly using insertable streams');
121136

137+
promise_test(async t => {
138+
return testVideoFlow(t, doInverseSignalingHandshake);
139+
}, 'Frames flow correctly using insertable streams when receiver starts negotiation');
140+
122141
promise_test(async t => {
123142
const caller = new RTCPeerConnection();
124143
t.add_cleanup(() => caller.close());

0 commit comments

Comments
 (0)