mirror of
https://github.com/servo/servo.git
synced 2025-08-31 10:08:21 +01:00
Update web-platform-tests to revision 6087baf4a83e7953112242be9fd6e719797ebdf6
This commit is contained in:
parent
3c19cd49ec
commit
6c2d26eb4b
76 changed files with 3020 additions and 345 deletions
|
@ -155,11 +155,6 @@
|
|||
}));
|
||||
}, 'addTrack(): Media stream stats references track stats');
|
||||
|
||||
// TODO(hbos): addStream() is legacy API not in the spec. Based on discussion
|
||||
// whether to standardize in legacy section, consider removing this test or
|
||||
// keeping it until addTrack() has wide support.
|
||||
// https://github.com/w3c/webrtc-pc/issues/1705
|
||||
// https://github.com/w3c/webrtc-pc/issues/1125
|
||||
async_test(t => {
|
||||
const pc = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc.close());
|
||||
|
@ -170,7 +165,8 @@
|
|||
track = tracks[0];
|
||||
stream = streams[0];
|
||||
stream.addTrack(track);
|
||||
pc.addStream(stream);
|
||||
for (const track of stream.getTracks())
|
||||
pc.addTrack(track, stream);
|
||||
return pc.createOffer();
|
||||
}))
|
||||
.then(t.step_func(offer => {
|
||||
|
@ -193,7 +189,7 @@
|
|||
.catch(t.step_func(reason => {
|
||||
assert_unreached(reason);
|
||||
}));
|
||||
}, 'Legacy addStream(): Media stream stats references track stats');
|
||||
}, 'Media stream stats references track stats');
|
||||
|
||||
async_test(t => {
|
||||
const caller = new RTCPeerConnection();
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
RTCDtxStatus dtx;
|
||||
boolean active;
|
||||
RTCPriorityType priority;
|
||||
RTCPriorityType networkPriority;
|
||||
unsigned long ptime;
|
||||
unsigned long maxBitrate;
|
||||
double maxFramerate;
|
||||
|
@ -146,6 +147,7 @@
|
|||
dtx: 'enabled',
|
||||
active: false,
|
||||
priority: 'low',
|
||||
networkPriority: 'low',
|
||||
ptime: 5,
|
||||
maxBitrate: 8,
|
||||
maxFramerate: 25,
|
||||
|
@ -161,6 +163,7 @@
|
|||
assert_equals(encoding.dtx, 'enabled');
|
||||
assert_equals(encoding.active, false);
|
||||
assert_equals(encoding.priority, 'low');
|
||||
assert_equals(encoding.networkPriority, 'low');
|
||||
assert_equals(encoding.ptime, 5);
|
||||
assert_equals(encoding.maxBitrate, 8);
|
||||
assert_equals(encoding.maxFramerate, 25);
|
||||
|
@ -339,6 +342,9 @@
|
|||
test_modified_encoding('audio', 'priority', 'very-low', 'high',
|
||||
'setParameters() with modified encoding.priority should succeed');
|
||||
|
||||
test_modified_encoding('audio', 'networkPriority', 'very-low', 'high',
|
||||
'setParameters() with modified encoding.networkPriority should succeed');
|
||||
|
||||
test_modified_encoding('audio', 'ptime', 2, 4,
|
||||
'setParameters() with modified encoding.ptime should succeed');
|
||||
|
||||
|
|
|
@ -142,6 +142,7 @@ function validateRtpParameters(param) {
|
|||
RTCDtxStatus dtx;
|
||||
boolean active;
|
||||
RTCPriorityType priority;
|
||||
RTCPriorityType networkPriority;
|
||||
unsigned long ptime;
|
||||
unsigned long maxBitrate;
|
||||
double maxFramerate;
|
||||
|
@ -171,6 +172,8 @@ function validateEncodingParameters(encoding) {
|
|||
assert_optional_boolean_field(encoding, 'active');
|
||||
assert_optional_enum_field(encoding, 'priority',
|
||||
['very-low', 'low', 'medium', 'high']);
|
||||
assert_optional_enum_field(encoding, 'networkPriority',
|
||||
['very-low', 'low', 'medium', 'high']);
|
||||
|
||||
assert_optional_unsigned_int_field(encoding, 'ptime');
|
||||
assert_optional_unsigned_int_field(encoding, 'maxBitrate');
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<meta name="timeout" content="long">
|
||||
<title>RTCPeerConnection legacy addStream</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../RTCPeerConnection-helper.js"></script>
|
||||
<script src="../RTCStats-helper.js"></script>
|
||||
<script src="../dictionary-helper.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
// The following helper functions are called from RTCPeerConnection-helper.js:
|
||||
// getUserMediaTracksAndStreams
|
||||
|
||||
// The following helper functions are called from RTCStats-helper.js
|
||||
// (depends on dictionary-helper.js):
|
||||
// validateRtcStats
|
||||
|
||||
// TODO(hbos): addStream() is legacy API not in the spec. Based on discussion
|
||||
// whether to standardize in legacy section, consider removing this test or
|
||||
// keeping it until addTrack() has wide support.
|
||||
// https://github.com/w3c/webrtc-pc/issues/1705
|
||||
// https://github.com/w3c/webrtc-pc/issues/1125
|
||||
async_test(t => {
|
||||
const pc = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc.close());
|
||||
let track;
|
||||
let stream;
|
||||
return getUserMediaTracksAndStreams(1)
|
||||
.then(t.step_func(([tracks, streams]) => {
|
||||
track = tracks[0];
|
||||
stream = streams[0];
|
||||
stream.addTrack(track);
|
||||
pc.addStream(stream);
|
||||
return pc.createOffer();
|
||||
}))
|
||||
.then(t.step_func(offer => {
|
||||
return pc.setLocalDescription(offer);
|
||||
}))
|
||||
.then(t.step_func(() => {
|
||||
return pc.getStats();
|
||||
}))
|
||||
.then(t.step_func(report => {
|
||||
let trackStats = findStatsByTypeAndId(report, 'track', track.id);
|
||||
let streamStats = findStatsByTypeAndId(report, 'stream', stream.id);
|
||||
assert_true(trackStats != null && streamStats != null,
|
||||
'Has stats for track and stream');
|
||||
assert_array_equals(streamStats.trackIds, [ trackStats.id ],
|
||||
'streamStats.trackIds == [ trackStats.id ]');
|
||||
validateRtcStats(report, trackStats);
|
||||
validateRtcStats(report, streamStats);
|
||||
t.done();
|
||||
}))
|
||||
.catch(t.step_func(reason => {
|
||||
assert_unreached(reason);
|
||||
}));
|
||||
}, 'Legacy addStream(): Media stream stats references track stats');
|
||||
|
||||
function findStatsByTypeAndId(report, type, identifier) {
|
||||
return findStats(report, stats => {
|
||||
return stats.type == type && stats[type + 'Identifier'] == identifier;
|
||||
});
|
||||
}
|
||||
|
||||
function findStats(report, findFunc) {
|
||||
for (let it = report.values(), n = it.next(); !n.done; n = it.next()) {
|
||||
if (findFunc(n.value))
|
||||
return n.value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
</script>
|
|
@ -1,7 +1,4 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
This test uses the legacy callback API with no media, and thus does not require fake media devices.
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
@ -37,7 +34,6 @@ This test uses the legacy callback API with no media, and thus does not require
|
|||
|
||||
var parsedOffer = new RTCSessionDescription({ type: 'offer',
|
||||
sdp: offerSdp });
|
||||
// These functions use the legacy interface extensions to RTCPeerConnection.
|
||||
gSecondConnection.setRemoteDescription(parsedOffer).then(
|
||||
function() {
|
||||
gSecondConnection.createAnswer().then(onAnswerCreated,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue