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:
Boris Zbarsky 2020-01-21 11:17:39 +00:00
Родитель af5251e666
Коммит df14f47c89
1 изменённых файлов: 14 добавлений и 14 удалений

Просмотреть файл

@ -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
}));