Skip to content

Commit

Permalink
Revert "Reorganize WebRTC-SVC tests in multiple files"
Browse files Browse the repository at this point in the history
This reverts commit d9833d1.

Reason for revert: Failing on mac builds see crbug 1392825

Original change's description:
> Reorganize WebRTC-SVC tests in multiple files
>
> A single file with all the tests used to timeout as it would
> take too long.
>
> Bug: 986069
> Change-Id: I576b4ed4f3a1ebba66b22aa66809729301b5da4c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4047189
> Commit-Queue: Florent Castelli <orphis@chromium.org>
> Reviewed-by: Harald Alvestrand <hta@chromium.org>
> Auto-Submit: Florent Castelli <orphis@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1074684}

Bug: 986069
Change-Id: Iba74451bd97c4bff21d02f544514715bf095204d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4049089
Auto-Submit: Jeffrey Cohen <jeffreycohen@chromium.org>
Owners-Override: Jeffrey Cohen <jeffreycohen@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1074849}
  • Loading branch information
Jeffrey Cohen authored and Chromium LUCI CQ committed Nov 22, 2022
1 parent 9382a51 commit 2b7e820
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 241 deletions.

This file was deleted.

@@ -1,10 +1,30 @@
This is a testharness.js-based test.
PASS [0] video/VP8 - L1T2 should produce valid video content
PASS [1] video/VP8 - L1T3 should produce valid video content
PASS [2] video/VP9 - L1T2 should produce valid video content
PASS [3] video/VP9 - L1T3 should produce valid video content
PASS [4] video/AV1 - L1T2 should produce valid video content
PASS [5] video/AV1 - L1T3 should produce valid video content
PASS [6] video/AV1 - L2T1 should produce valid video content
PASS [7] video/AV1 - L2T1h should produce valid video content
PASS [8] video/AV1 - L2T1_KEY should produce valid video content
PASS [9] video/AV1 - L2T2 should produce valid video content
PASS [10] video/AV1 - L2T2_KEY should produce valid video content
PASS [11] video/AV1 - L2T2_KEY_SHIFT should produce valid video content
PASS [12] video/AV1 - L3T1 should produce valid video content
PASS [13] video/AV1 - L3T3 should produce valid video content
PASS [14] video/AV1 - L3T3_KEY should produce valid video content
PASS [15] video/AV1 - S2T1 should produce valid video content
PASS Setting and updating scalabilityMode to a legal value should be accepted
PASS Sender capabilities should include at least some scalability modes
PASS Not setting sendEncodings results in no mode info before negotiation
PASS Not setting a scalability mode results in no mode set before negotiation
FAIL Not setting a scalability mode results in some mode set after negotiation assert_true: expected true got false
PASS Setting a scalability mode to nonsense throws an exception
FAIL Setting a scalability mode to nonsense throws an exception assert_throws_dom: function "() => {
pc.addTransceiver('video', {
sendEncodings: [{scalabilityMode: 'TotalNonsense'}],
});
}" did not throw
FAIL L3T3 on VP8 should return something other than L3T3 assert_not_equals: got disallowed value "L3T3"
Harness: the test ran to completion.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,6 +1,5 @@
<!doctype html>
<meta charset=utf-8>
<meta name="timeout" content="long">
<title>RTCRtpParameters encodings</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand All @@ -13,6 +12,46 @@
// Test is based on the following editor draft:
// https://w3c.github.io/webrtc-svc/

// Get the first encoding in param.encodings.
// Asserts that param.encodings has at least one element.
function getFirstEncoding(param) {
const { encodings } = param;
assert_equals(encodings.length, 1);
return encodings[0];
}

const capabilities = RTCRtpSender.getCapabilities('video');
let index = 0;
for (const codec of capabilities.codecs) {
if ('scalabilityModes' in codec && codec.scalabilityModes.length > 0) {
for (const scalabilityMode of codec.scalabilityModes) {
promise_test(async t => {
const v = document.createElement('video');
v.autoplay = true;
const pc1 = new RTCPeerConnection();
const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
t.add_cleanup(() => pc2.close());
const stream1 = await getNoiseStream({ video: { signal: 100 , width: 60, height: 60} });
const [track1] = stream1.getTracks();
t.add_cleanup(() => track1.stop());
const transceiver = pc1.addTransceiver(track1, {
sendEncodings: [{ scalabilityMode: scalabilityMode }],
});
transceiver.setCodecPreferences([codec]);
const haveTrackEvent = new Promise(r => pc2.ontrack = r);
exchangeIceCandidates(pc1, pc2);
await exchangeOfferAnswer(pc1, pc2);
v.srcObject = new MediaStream([(await haveTrackEvent).track]);
await new Promise(r => v.onloadedmetadata = r);
await detectSignal(t, v, 100);
const sendParams = pc1.getSenders()[0].getParameters();
assert_equals(sendParams.encodings[0].scalabilityMode, scalabilityMode);
}, `[${index++}] ${codec.mimeType} - ${scalabilityMode} should produce valid video content`);
}
}
}

promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
Expand Down Expand Up @@ -45,78 +84,81 @@
assert_true(svcSupported);
}, `Sender capabilities should include at least some scalability modes`);

promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const { sender } = pc.addTransceiver('video');
const param = sender.getParameters();
assert_equals(param.encodings.length, 0);
}, 'Not setting sendEncodings results in no mode info before negotiation');
promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const { sender } = pc.addTransceiver('video');
const param = sender.getParameters();
assert_equals(param.encodings.length, 0);
}, 'Not setting sendEncodings results in no mode info before negotiation');

promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const { sender } = pc.addTransceiver('video', {
sendEncodings: [{}],
});
const param = sender.getParameters();
const encoding = getFirstEncoding(param);
promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const { sender } = pc.addTransceiver('video', {
sendEncodings: [{}],
});
const param = sender.getParameters();
const encoding = getFirstEncoding(param);

assert_true(!('scalabilityMode' in encoding));
}, 'Not setting a scalability mode results in no mode set before negotiation');
assert_true(!('scalabilityMode' in encoding));
}, 'Not setting a scalability mode results in no mode set before negotiation');

promise_test(async t => {
const pc1 = new RTCPeerConnection();
const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
t.add_cleanup(() => pc2.close());
const { sender } = pc1.addTransceiver('video', {
sendEncodings: [{}],
});
const param = sender.getParameters();
const encoding = getFirstEncoding(param);
promise_test(async t => {
const pc1 = new RTCPeerConnection();
const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
t.add_cleanup(() => pc2.close());
const { sender } = pc1.addTransceiver('video', {
sendEncodings: [{}],
});
const param = sender.getParameters();
const encoding = getFirstEncoding(param);

exchangeIceCandidates(pc1, pc2);
await exchangeOfferAnswer(pc1, pc2);
const param2 = sender.getParameters();
const encoding2 = getFirstEncoding(param);
assert_true('scalabilityMode' in encoding2);
}, 'Not setting a scalability mode results in some mode set after negotiation');
exchangeIceCandidates(pc1, pc2);
await exchangeOfferAnswer(pc1, pc2);
const param2 = sender.getParameters();
const encoding2 = getFirstEncoding(param);
assert_true('scalabilityMode' in encoding2);
}, 'Not setting a scalability mode results in some mode set after negotiation');

promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
assert_throws_dom('OperationError', () => {
pc.addTransceiver('video', {
sendEncodings: [{scalabilityMode: 'TotalNonsense'}],
});
promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
assert_throws_dom('OperationError', () => {
pc.addTransceiver('video', {
sendEncodings: [{scalabilityMode: 'TotalNonsense'}],
});
}, 'Setting a scalability mode to nonsense throws an exception');
});
}, 'Setting a scalability mode to nonsense throws an exception');


promise_test(async t => {
const v = document.createElement('video');
v.autoplay = true;
const pc1 = new RTCPeerConnection();
const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
t.add_cleanup(() => pc2.close());
const transceiver = pc1.addTransceiver('video', {
sendEncodings: [{ scalabilityMode: 'L3T3' }],
});
// Before negotiation, the mode should be preserved.
const param = transceiver.sender.getParameters();
const encoding = getFirstEncoding(param);
assert_true('scalabilityMode' in encoding);
// If L3T3 is not supported at all, abort test.
assert_implements_optional(encoding.scalabilityMode === 'L3T3');
// Pick a codec known to not have L3T3 support
const capabilities = RTCRtpSender.getCapabilities('video');
const codec = capabilities.codecs.find(c => c.mimeType === 'video/VP8');
assert_true(codec !== undefined);
transceiver.setCodecPreferences([codec]);
exchangeIceCandidates(pc1, pc2);
await exchangeOfferAnswer(pc1, pc2);
const sendParams = pc1.getSenders()[0].getParameters();
assert_not_equals(sendParams.encodings[0].scalabilityMode, 'L3T3');
}, 'L3T3 on VP8 should return something other than L3T3');


promise_test(async t => {
const v = document.createElement('video');
v.autoplay = true;
const pc1 = new RTCPeerConnection();
const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
t.add_cleanup(() => pc2.close());
const transceiver = pc1.addTransceiver('video', {
sendEncodings: [{ scalabilityMode: 'L3T3' }],
});
// Before negotiation, the mode should be preserved.
const param = transceiver.sender.getParameters();
const encoding = getFirstEncoding(param);
assert_true('scalabilityMode' in encoding);
// If L3T3 is not supported at all, abort test.
assert_implements_optional(encoding.scalabilityMode === 'L3T3');
// Pick a codec known to not have L3T3 support
const capabilities = RTCRtpSender.getCapabilities('video');
const codec = capabilities.codecs.find(c => c.mimeType === 'video/VP8');
assert_true(codec !== undefined);
transceiver.setCodecPreferences([codec]);
exchangeIceCandidates(pc1, pc2);
await exchangeOfferAnswer(pc1, pc2);
const sendParams = pc1.getSenders()[0].getParameters();
assert_not_equals(sendParams.encodings[0].scalabilityMode, 'L3T3');
}, 'L3T3 on VP8 should return something other than L3T3');
</script>

0 comments on commit 2b7e820

Please sign in to comment.