Bug 1610422 part 2. Revert the bug 1609859 canges to RTCPeerConnection-createDataChannel.html. r=jgraham

This is a clean revert of the changes bug 1609859 made to
RTCPeerConnection-createDataChannel.html.  It's separated out for review ease;
these changes are reinstated 2 changesets later.

Differential Revision: https://phabricator.services.mozilla.com/D60470

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Boris Zbarsky 2020-01-21 11:16:59 +00:00
Родитель 5f84a2e9df
Коммит 563e26b4d2
1 изменённых файлов: 15 добавлений и 15 удалений

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

@ -61,7 +61,7 @@ test(t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
assert_equals(pc.createDataChannel.length, 1);
assert_throws_js(TypeError, () => pc.createDataChannel());
assert_throws(new TypeError(), () => pc.createDataChannel());
}, 'createDataChannel with no argument should throw TypeError');
/*
6.2. createDataChannel
@ -257,11 +257,11 @@ test(t => {
test(t => {
const pc = new RTCPeerConnection;
t.add_cleanup(() => pc.close());
assert_throws_js(TypeError, () => pc.createDataChannel('', {
assert_throws(new TypeError(), () => pc.createDataChannel('', {
maxPacketLifeTime: 0,
maxRetransmits: 0
}));
assert_throws_js(TypeError, () => pc.createDataChannel('', {
assert_throws(new TypeError(), () => pc.createDataChannel('', {
maxPacketLifeTime: 42,
maxRetransmits: 42
}));
@ -313,7 +313,7 @@ for (const id of [-1, 65536]) {
test((t) => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
assert_throws_js(TypeError, () => pc.createDataChannel('', { id }));
assert_throws(new TypeError(), () => pc.createDataChannel('', { id }));
}, `createDataChannel with id ${id} and negotiated not set should throw TypeError`);
}
for (const id of [-1, 65535, 65536]) {
@ -321,7 +321,7 @@ for (const id of [-1, 65535, 65536]) {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
assert_throws_js(TypeError, () => pc.createDataChannel('',
assert_throws(new TypeError(), () => pc.createDataChannel('',
{ 'negotiated': true, 'id': id }));
}, `createDataChannel with id ${id} should throw TypeError`);
}
@ -351,9 +351,9 @@ test(t => {
test(t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
assert_throws_js(TypeError, () =>
assert_throws(new TypeError(), () =>
pc.createDataChannel('l'.repeat(65536)));
assert_throws_js(TypeError, () =>
assert_throws(new TypeError(), () =>
pc.createDataChannel('l'.repeat(65536), {
negotiated: true,
id: 42
@ -363,9 +363,9 @@ test(t => {
test(t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
assert_throws_js(TypeError, () =>
assert_throws(new TypeError(), () =>
pc.createDataChannel('\u00b5'.repeat(32768)));
assert_throws_js(TypeError, () =>
assert_throws(new TypeError(), () =>
pc.createDataChannel('\u00b5'.repeat(32768), {
negotiated: true,
id: 42
@ -397,11 +397,11 @@ test(t => {
test(t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
assert_throws_js(TypeError, () =>
assert_throws(new TypeError(), () =>
pc.createDataChannel('', {
protocol: 'p'.repeat(65536)
}));
assert_throws_js(TypeError, () =>
assert_throws(new TypeError(), () =>
pc.createDataChannel('', {
protocol: 'p'.repeat(65536),
negotiated: true,
@ -412,11 +412,11 @@ test(t => {
test(t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
assert_throws_js(TypeError, () =>
assert_throws(new TypeError(), () =>
pc.createDataChannel('', {
protocol: '\u00b6'.repeat(32768)
}));
assert_throws_js(TypeError, () =>
assert_throws(new TypeError(), () =>
pc.createDataChannel('', {
protocol: '\u00b6'.repeat(32768),
negotiated: true,
@ -470,7 +470,7 @@ test(t => {
test(t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
assert_throws_js(TypeError, () =>
assert_throws(new TypeError(), () =>
pc.createDataChannel('test', {
negotiated: true
}));
@ -479,7 +479,7 @@ test(t => {
test(t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
assert_throws_js(TypeError, () =>
assert_throws(new TypeError(), () =>
pc.createDataChannel('test', {
negotiated: true,
id: null