зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1610422 part 4. Reinstate the changes from bug 1609859 to RTCPeerConnection-createDataChannel.html. r=jgraham
This just reapplies the changes, with some context edits because the whitespace changed. Differential Revision: https://phabricator.services.mozilla.com/D60471 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
af5251e666
Коммит
df14f47c89
|
@ -69,7 +69,7 @@ test(t => {
|
|||
t.add_cleanup(() => pc.close());
|
||||
|
||||
assert_equals(pc.createDataChannel.length, 1);
|
||||
assert_throws(new TypeError(), () => pc.createDataChannel());
|
||||
assert_throws_js(TypeError, () => pc.createDataChannel());
|
||||
}, 'createDataChannel with no argument should throw TypeError');
|
||||
|
||||
/*
|
||||
|
@ -292,11 +292,11 @@ test(t => {
|
|||
const pc = new RTCPeerConnection;
|
||||
t.add_cleanup(() => pc.close());
|
||||
|
||||
assert_throws(new TypeError(), () => pc.createDataChannel('', {
|
||||
assert_throws_js(TypeError, () => pc.createDataChannel('', {
|
||||
maxPacketLifeTime: 0,
|
||||
maxRetransmits: 0
|
||||
}));
|
||||
assert_throws(new TypeError(), () => pc.createDataChannel('', {
|
||||
assert_throws_js(TypeError, () => pc.createDataChannel('', {
|
||||
maxPacketLifeTime: 42,
|
||||
maxRetransmits: 42
|
||||
}));
|
||||
|
@ -353,7 +353,7 @@ for (const id of [-1, 65536]) {
|
|||
test((t) => {
|
||||
const pc = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc.close());
|
||||
assert_throws(new TypeError(), () => pc.createDataChannel('', { id }));
|
||||
assert_throws_js(TypeError, () => pc.createDataChannel('', { id }));
|
||||
}, `createDataChannel with id ${id} and negotiated not set should throw TypeError`);
|
||||
}
|
||||
|
||||
|
@ -362,7 +362,7 @@ for (const id of [-1, 65535, 65536]) {
|
|||
const pc = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc.close());
|
||||
|
||||
assert_throws(new TypeError(), () => pc.createDataChannel('',
|
||||
assert_throws_js(TypeError, () => pc.createDataChannel('',
|
||||
{ 'negotiated': true, 'id': id }));
|
||||
}, `createDataChannel with id ${id} should throw TypeError`);
|
||||
}
|
||||
|
@ -397,10 +397,10 @@ test(t => {
|
|||
const pc = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc.close());
|
||||
|
||||
assert_throws(new TypeError(), () =>
|
||||
assert_throws_js(TypeError, () =>
|
||||
pc.createDataChannel('l'.repeat(65536)));
|
||||
|
||||
assert_throws(new TypeError(), () =>
|
||||
assert_throws_js(TypeError, () =>
|
||||
pc.createDataChannel('l'.repeat(65536), {
|
||||
negotiated: true,
|
||||
id: 42
|
||||
|
@ -411,10 +411,10 @@ test(t => {
|
|||
const pc = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc.close());
|
||||
|
||||
assert_throws(new TypeError(), () =>
|
||||
assert_throws_js(TypeError, () =>
|
||||
pc.createDataChannel('\u00b5'.repeat(32768)));
|
||||
|
||||
assert_throws(new TypeError(), () =>
|
||||
assert_throws_js(TypeError, () =>
|
||||
pc.createDataChannel('\u00b5'.repeat(32768), {
|
||||
negotiated: true,
|
||||
id: 42
|
||||
|
@ -452,12 +452,12 @@ test(t => {
|
|||
const pc = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc.close());
|
||||
|
||||
assert_throws(new TypeError(), () =>
|
||||
assert_throws_js(TypeError, () =>
|
||||
pc.createDataChannel('', {
|
||||
protocol: 'p'.repeat(65536)
|
||||
}));
|
||||
|
||||
assert_throws(new TypeError(), () =>
|
||||
assert_throws_js(TypeError, () =>
|
||||
pc.createDataChannel('', {
|
||||
protocol: 'p'.repeat(65536),
|
||||
negotiated: true,
|
||||
|
@ -469,12 +469,12 @@ test(t => {
|
|||
const pc = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc.close());
|
||||
|
||||
assert_throws(new TypeError(), () =>
|
||||
assert_throws_js(TypeError, () =>
|
||||
pc.createDataChannel('', {
|
||||
protocol: '\u00b6'.repeat(32768)
|
||||
}));
|
||||
|
||||
assert_throws(new TypeError(), () =>
|
||||
assert_throws_js(TypeError, () =>
|
||||
pc.createDataChannel('', {
|
||||
protocol: '\u00b6'.repeat(32768),
|
||||
negotiated: true,
|
||||
|
@ -537,7 +537,7 @@ test(t => {
|
|||
const pc = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc.close());
|
||||
|
||||
assert_throws(new TypeError(), () =>
|
||||
assert_throws_js(TypeError, () =>
|
||||
pc.createDataChannel('test', {
|
||||
negotiated: true
|
||||
}));
|
||||
|
|
Загрузка…
Ссылка в новой задаче