Update web-platform-tests to revision be959408023fe02cf79abe70f6018598a7004a88

This commit is contained in:
WPT Sync Bot 2018-06-11 21:57:51 -04:00
parent a76777b115
commit 761c8bc2a9
171 changed files with 2434 additions and 907 deletions

View file

@ -14,7 +14,6 @@
// generateOffer
// assert_session_desc_not_equals
// assert_session_desc_equals
// test_state_change_event
/*
4.3.2. Interface Definition
@ -58,7 +57,10 @@
*/
promise_test(t => {
const pc = new RTCPeerConnection();
test_state_change_event(t, pc, ['have-local-offer']);
t.add_cleanup(() => pc.close());
const states = [];
pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
return pc.createOffer({ offerToReceiveAudio: true })
.then(offer =>
@ -68,6 +70,8 @@
assert_session_desc_equals(pc.localDescription, offer);
assert_session_desc_equals(pc.pendingLocalDescription, offer);
assert_equals(pc.currentLocalDescription, null);
assert_array_equals(states, ['have-local-offer']);
}));
}, 'setLocalDescription with valid offer should succeed');
@ -79,6 +83,7 @@
*/
promise_test(t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
return pc.createOffer({ offerToReceiveAudio: true })
.then(offer =>
pc.setLocalDescription({ type: 'offer' })
@ -99,8 +104,11 @@
*/
promise_test(t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc2.close());
return generateOffer({ pc, data: true })
.then(offer =>
promise_rejects(t, 'InvalidModificationError',
@ -113,6 +121,7 @@
// last offer, setLocalDescription would reject when setting
// with the first offer
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
return pc.createOffer({ offerToReceiveAudio: true })
.then(offer1 =>
pc.createOffer({ offerToReceiveVideo: true })
@ -125,9 +134,10 @@
promise_test(t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
// Only one state change event should be fired
test_state_change_event(t, pc, ['have-local-offer']);
const states = [];
pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
return pc.createOffer({ offerToReceiveAudio: true })
.then(offer1 =>
@ -142,6 +152,8 @@
assert_session_desc_equals(pc.localDescription, offer2);
assert_session_desc_equals(pc.pendingLocalDescription, offer2);
assert_equals(pc.currentLocalDescription, null);
assert_array_equals(states, ['have-local-offer']);
}))));
}, 'Creating and setting offer multiple times should succeed');