Skip to content

Commit

Permalink
Bug 1869313 [wpt PR 43601] - Switch default for RTCDataChannel.binary…
Browse files Browse the repository at this point in the history
…Type to arraybuffer, a=testonly

Automatic update from web-platform-tests
Switch default for RTCDataChannel.binaryType to arraybuffer (#43601)

per w3c/webrtc-pc#2913
--

wpt-commits: 12f0d5e0f467e8aed015ea2d48cd4a8d767a2a27
wpt-pr: 43601

UltraBlame original commit: 12e5a51676774b1bb3a26c8da254390c9813d86d
  • Loading branch information
marco-c committed Dec 16, 2023
1 parent f531866 commit 8c2a3be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test((t) => {
t.add_cleanup(() => pc.close());
const dc = pc.createDataChannel('test-binary-type');

assert_equals(dc.binaryType, "blob", `dc.binaryType should be 'blob'`);
assert_equals(dc.binaryType, "arraybuffer", `dc.binaryType should be 'arraybuffer'`);
}, `Default binaryType value`);

for (const binaryType of validBinaryTypes) {
Expand Down
12 changes: 3 additions & 9 deletions testing/web-platform/tests/webrtc/RTCDataChannel-send.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,24 +261,18 @@
promise_test(t => {
return createDataChannelPair(t, options)
.then(([channel1, channel2]) => {
assert_equals(channel2.binaryType, 'blob',
'Expect initial binaryType value to be blob');
assert_equals(channel2.binaryType, 'arraybuffer',
'Expect initial binaryType value to be arraybuffer');

channel1.send(helloBuffer);
return awaitMessage(channel2);
})
.then(messageBlob => {
assert_true(messageBlob instanceof Blob,
'Expect received messageBlob to be a Blob');

return blobToArrayBuffer(messageBlob);
}).then(messageBuffer => {
assert_true(messageBuffer instanceof ArrayBuffer,
'Expect messageBuffer to be an ArrayBuffer');

assert_equals_typed_array(messageBuffer, helloBuffer.buffer);
});
}, `${mode} binaryType should receive message as Blob by default`);
}, `${mode} binaryType should receive message as ArrayBuffer by default`);

// Test sending 3 messages: helloBuffer, unicodeString, helloBlob
async_test(t => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
assert_equals(dc.readyState, 'connecting');
assert_equals(dc.bufferedAmount, 0);
assert_equals(dc.bufferedAmountLowThreshold, 0);
assert_equals(dc.binaryType, 'blob');
assert_equals(dc.binaryType, 'arraybuffer');
}, 'createDataChannel attribute default values');

test(t => {
Expand All @@ -166,7 +166,7 @@
assert_equals(dc.readyState, 'connecting');
assert_equals(dc.bufferedAmount, 0);
assert_equals(dc.bufferedAmountLowThreshold, 0);
assert_equals(dc.binaryType, 'blob');
assert_equals(dc.binaryType, 'arraybuffer');

const dc2 = pc.createDataChannel('test2', {
ordered: false,
Expand Down

0 comments on commit 8c2a3be

Please sign in to comment.