mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision cd44958a002b1ad494168e0290554644de84526e
This commit is contained in:
parent
2ed23ce4c9
commit
4443426308
103 changed files with 1740 additions and 1138 deletions
|
@ -247,7 +247,7 @@
|
|||
// tonechange event, to make sure that tonechange is triggered
|
||||
// then stopped
|
||||
if(tone === 'A') {
|
||||
transceiver.setDirection('recvonly');
|
||||
transceiver.direction = 'recvonly';
|
||||
|
||||
pc.createOffer()
|
||||
.then(offer =>
|
||||
|
|
|
@ -85,57 +85,27 @@
|
|||
}));
|
||||
}, 'replaceTrack() rejects when the peer connection is closed.');
|
||||
|
||||
async_test(t => {
|
||||
const expectedException = 'InvalidModificationError';
|
||||
promise_test(async t => {
|
||||
const caller = new RTCPeerConnection();
|
||||
t.add_cleanup(() => caller.close());
|
||||
return getUserMediaTracksAndStreams(2)
|
||||
.then(t.step_func(([tracks, streams]) => {
|
||||
const sender = caller.addTrack(tracks[0], streams[0]);
|
||||
caller.removeTrack(sender);
|
||||
// replaceTrack() should fail because the sender should be inactive after
|
||||
// removeTrack().
|
||||
return sender.replaceTrack(tracks[1])
|
||||
.then(t.step_func(() => {
|
||||
assert_unreached('Expected replaceTrack() to be rejected with ' +
|
||||
expectedException + ' but the promise was resolved.');
|
||||
}),
|
||||
t.step_func(e => {
|
||||
assert_equals(e.name, expectedException);
|
||||
t.done();
|
||||
}));
|
||||
}))
|
||||
.catch(t.step_func(reason => {
|
||||
assert_unreached(reason);
|
||||
}));
|
||||
}, 'replaceTrack() rejects when invoked after removeTrack().');
|
||||
const [tracks, streams] = await getUserMediaTracksAndStreams(2);
|
||||
const sender = caller.addTrack(tracks[0], streams[0]);
|
||||
caller.removeTrack(sender);
|
||||
await sender.replaceTrack(tracks[1]);
|
||||
assert_equals(sender.track, tracks[1], "Make sure track gets updated");
|
||||
}, 'replaceTrack() does not reject when invoked after removeTrack().');
|
||||
|
||||
async_test(t => {
|
||||
const expectedException = 'InvalidModificationError';
|
||||
|
||||
promise_test(async t => {
|
||||
const caller = new RTCPeerConnection();
|
||||
t.add_cleanup(() => caller.close());
|
||||
return getUserMediaTracksAndStreams(2)
|
||||
.then(t.step_func(([tracks, streams]) => {
|
||||
const sender = caller.addTrack(tracks[0], streams[0]);
|
||||
let p = sender.replaceTrack(tracks[1])
|
||||
caller.removeTrack(sender);
|
||||
// replaceTrack() should fail because it executes steps in parallel and
|
||||
// queues a task to execute after removeTrack() has occurred. The sender
|
||||
// should be inactive. If this can be racy, update or remove the test.
|
||||
// https://github.com/w3c/webrtc-pc/issues/1728
|
||||
return p.then(t.step_func(() => {
|
||||
assert_unreached('Expected replaceTrack() to be rejected with ' +
|
||||
expectedException + ' but the promise was resolved.');
|
||||
}),
|
||||
t.step_func(e => {
|
||||
assert_equals(e.name, expectedException);
|
||||
t.done();
|
||||
}));
|
||||
}))
|
||||
.catch(t.step_func(reason => {
|
||||
assert_unreached(reason);
|
||||
}));
|
||||
}, 'replaceTrack() rejects after a subsequent removeTrack().');
|
||||
const [tracks, streams] = await getUserMediaTracksAndStreams(2);
|
||||
const sender = caller.addTrack(tracks[0], streams[0]);
|
||||
let p = sender.replaceTrack(tracks[1])
|
||||
caller.removeTrack(sender);
|
||||
await p;
|
||||
assert_equals(sender.track, tracks[1], "Make sure track gets updated");
|
||||
}, 'replaceTrack() does not reject after a subsequent removeTrack().');
|
||||
|
||||
// TODO(hbos): Verify that replaceTrack() changes what media is received on
|
||||
// the remote end of two connected peer connections. For video tracks, this
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>RTCRtpTransceiver.prototype.setDirection</title>
|
||||
<title>RTCRtpTransceiver.prototype.direction</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="RTCPeerConnection-helper.js"></script>
|
||||
|
@ -8,7 +8,7 @@
|
|||
'use strict';
|
||||
|
||||
// Test is based on the following editor draft:
|
||||
// https://rawgit.com/w3c/webrtc-pc/cc8d80f455b86c8041d63bceb8b457f45c72aa89/webrtc.html
|
||||
// https://rawgit.com/w3c/webrtc-pc/8495678808d126d8bc764bf944996f32981fa6fd/webrtc.html
|
||||
|
||||
// The following helper functions are called from RTCPeerConnection-helper.js:
|
||||
// generateAnswer
|
||||
|
@ -16,16 +16,15 @@
|
|||
/*
|
||||
5.4. RTCRtpTransceiver Interface
|
||||
interface RTCRtpTransceiver {
|
||||
readonly attribute RTCRtpTransceiverDirection direction;
|
||||
attribute RTCRtpTransceiverDirection direction;
|
||||
readonly attribute RTCRtpTransceiverDirection? currentDirection;
|
||||
void setDirection(RTCRtpTransceiverDirection direction);
|
||||
...
|
||||
};
|
||||
*/
|
||||
|
||||
/*
|
||||
5.4. setDirection
|
||||
4. Set transceiver's [[Direction]] slot to newDirection.
|
||||
5.4. direction
|
||||
7. Set transceiver's [[Direction]] slot to newDirection.
|
||||
*/
|
||||
test(t => {
|
||||
const pc = new RTCPeerConnection();
|
||||
|
@ -33,15 +32,15 @@
|
|||
assert_equals(transceiver.direction, 'sendrecv');
|
||||
assert_equals(transceiver.currentDirection, null);
|
||||
|
||||
transceiver.setDirection('recvonly');
|
||||
transceiver.direction = 'recvonly';
|
||||
assert_equals(transceiver.direction, 'recvonly');
|
||||
assert_equals(transceiver.currentDirection, null,
|
||||
'Expect transceiver.currentDirection to not change');
|
||||
|
||||
}, 'setDirection should change transceiver.direction');
|
||||
}, 'setting direction should change transceiver.direction');
|
||||
|
||||
/*
|
||||
5.4. setDirection
|
||||
5.4. direction
|
||||
3. If newDirection is equal to transceiver's [[Direction]] slot, abort
|
||||
these steps.
|
||||
*/
|
||||
|
@ -49,10 +48,10 @@
|
|||
const pc = new RTCPeerConnection();
|
||||
const transceiver = pc.addTransceiver('audio', { direction: 'sendonly' });
|
||||
assert_equals(transceiver.direction, 'sendonly');
|
||||
transceiver.setDirection('sendonly');
|
||||
transceiver.direction = 'sendonly';
|
||||
assert_equals(transceiver.direction, 'sendonly');
|
||||
|
||||
}, 'setDirection with same direction should have no effect');
|
||||
}, 'setting direction with same direction should have no effect');
|
||||
|
||||
promise_test(t => {
|
||||
const pc = new RTCPeerConnection();
|
||||
|
@ -67,22 +66,22 @@
|
|||
.then(() => generateAnswer(offer)))
|
||||
.then(answer => pc.setRemoteDescription(answer))
|
||||
.then(() => {
|
||||
assert_equals(transceiver.currentDirection, 'recvonly');
|
||||
transceiver.setDirection('sendrecv');
|
||||
assert_equals(transceiver.currentDirection, 'inactive');
|
||||
transceiver.direction = 'sendrecv';
|
||||
assert_equals(transceiver.direction, 'sendrecv');
|
||||
assert_equals(transceiver.currentDirection, 'recvonly');
|
||||
assert_equals(transceiver.currentDirection, 'inactive');
|
||||
});
|
||||
}, 'setDirection should change transceiver.direction independent of transceiver.currentDirection');
|
||||
}, 'setting direction should change transceiver.direction independent of transceiver.currentDirection');
|
||||
|
||||
/*
|
||||
TODO
|
||||
Calls to setDirection() do not take effect immediately. Instead, future calls
|
||||
An update of directionality does not take effect immediately. Instead, future calls
|
||||
to createOffer and createAnswer mark the corresponding media description as
|
||||
sendrecv, sendonly, recvonly or inactive as defined in [JSEP] (section 5.2.2.
|
||||
and section 5.3.2.).
|
||||
|
||||
Tested in RTCPeerConnection-onnegotiationneeded.html
|
||||
5.4. setDirection
|
||||
5.4. direction
|
||||
6. Update the negotiation-needed flag for connection.
|
||||
|
||||
Coverage Report
|
|
@ -1181,7 +1181,7 @@
|
|||
"InvalidStateError", "replaceTrack on stopped transceiver");
|
||||
|
||||
checkThrows(() => transceiver.direction = "sendrecv",
|
||||
"InvalidStateError", "setDirection on stopped transceiver");
|
||||
"InvalidStateError", "set direction on stopped transceiver");
|
||||
|
||||
checkThrows(() => transceiver.sender.dtmf.insertDTMF("111"),
|
||||
"InvalidStateError", "insertDTMF on stopped transceiver");
|
||||
|
@ -1775,7 +1775,7 @@
|
|||
await pc2.setRemoteDescription({type: "rollback"});
|
||||
|
||||
// Transceiver should be _gone_, again. replaceTrack doesn't prevent this,
|
||||
// nor does setDirection.
|
||||
// nor does setting direction.
|
||||
hasProps(pc2.getTransceivers(), []);
|
||||
|
||||
// Setting the same offer for a _third_ time should do the same thing
|
||||
|
|
|
@ -24,6 +24,14 @@ test(function() {
|
|||
}, "RTCPeerConnection member " + name + " should not exist");
|
||||
});
|
||||
|
||||
[
|
||||
"setDirection",
|
||||
].forEach(function(name) {
|
||||
test(function() {
|
||||
assert_false(name in RTCRtpTransceiver.prototype);
|
||||
}, "RTCRtpTransceiver member " + name + " should not exist");
|
||||
});
|
||||
|
||||
[
|
||||
"DataChannel",
|
||||
"mozRTCIceCandidate",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue