Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More Tests for WebRTC Data Channels #13499

Closed
wants to merge 91 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
c6f99c9
Update RTCPeerConnection-createDataChannel tests
lgrahl Mar 26, 2018
76b2993
Update RTCPeerConnection-id to current spec version (only the
lgrahl Mar 26, 2018
7dc4f16
Add RTCPeerConnection-dcep tests which test whether data channel
lgrahl Mar 26, 2018
3fd7117
Update RTCSctpTransport-maxMessageSize tests
lgrahl Mar 27, 2018
f9c4238
Add exhausting ID tests to RTCSctpTransport-id tests
lgrahl Mar 28, 2018
8a3b2e4
Update the renegotiation test in RTCSctpTransport-maxMessageSize
lgrahl Mar 28, 2018
1cd5a0b
Fix RTCSctpTransport-id tests to always check for reused IDs
lgrahl Mar 29, 2018
e4c78a1
Add tests for data channel closing procedure when the peer connection…
lgrahl Mar 29, 2018
b048994
Fix do not attempt to keep data channels referenced since they should…
lgrahl Mar 29, 2018
db84808
Fix title of DCEP tests
lgrahl Mar 29, 2018
1c9b829
Update RTCSctpTransport-constructor tests
lgrahl Mar 30, 2018
69eaff6
Add RTCSctpTransport-onstatechange test which ensures that the event …
lgrahl Mar 30, 2018
64b09f9
Add test to ensure the SCTP transport attribute remains null in case …
lgrahl Apr 1, 2018
544d55a
Add test to ensure the SCTP transport attribute remains null in case …
lgrahl Apr 1, 2018
60a2351
Add test for SCTP transport closed state when the peer connection is …
lgrahl Apr 1, 2018
301f8fc
Add RTCDataChannel-onopen test
lgrahl Apr 1, 2018
7cc5689
Update RTCPeerConnection-ondatachannel to the current spec (descripti…
lgrahl Apr 1, 2018
473b628
Add RTCDataChannel-close which includes tests regarding the closing p…
lgrahl Apr 2, 2018
a56f956
Add untestable note to RTCDataChannel-close for data channel ids outs…
lgrahl Apr 2, 2018
f7341e4
Add test for RTCDataChannel label used twice
lgrahl Apr 2, 2018
04e1b39
Update the description of RTCDataChannel-bufferedAmount
lgrahl Apr 2, 2018
9845d35
Add RTCDataChannel-bufferedAmountLowThreshold which tests the buffere…
lgrahl Apr 2, 2018
7ebfa52
Fix a bunch of invalid 'done' timeouts I've added
lgrahl Apr 3, 2018
387430a
Update RTCDataChannel-send to the current spec
lgrahl Apr 3, 2018
31e9a22
Refactor and move empty string/buffer/blob tests into RTCDataChannel-…
lgrahl Apr 3, 2018
cf96229
Add test to RTCDataChannel-send which patches the remote maximum mess…
lgrahl Apr 4, 2018
8e8a5e8
Rename RTCDataChannel-send to RTCDataChannel-send-receive
lgrahl Apr 5, 2018
40a71ed
Add spec revision to RTCDataChannelEvent-constructor
lgrahl Apr 5, 2018
3ce8320
Add ID reuse test after close to RTCDataChannel-id
lgrahl Apr 5, 2018
9212587
Use different message sizes for tests in RTCDataChannel-bufferedAmoun…
lgrahl Apr 6, 2018
b94e547
Add timeout to tests in RTCDataChannel-bufferedAmountLowThreshold
lgrahl Apr 6, 2018
b1fe750
Update RTCDataChannel-close tests to close multiple channels
lgrahl Apr 6, 2018
249722e
Update RTCPeerConnection-ondatachannel, readyState should be 'connect…
lgrahl Apr 7, 2018
3111c80
Add test for checking the ready state of a newly created data channel…
lgrahl Apr 7, 2018
29a7968
Fix missing id when using negotiated: true for data channel long labe…
lgrahl Apr 7, 2018
3584fb1
Add test for data channel ID set to a number but negotiated set to false
lgrahl Apr 7, 2018
b6f2f42
Add test for maximum length label and protocol using 3 byte unicode w…
lgrahl Apr 8, 2018
96bad22
Add tests for too long protocol and too long label by using unicode c…
lgrahl Apr 8, 2018
85a3e30
Add more reliability parameter tests in RTCDataChannel-dcep
lgrahl Apr 8, 2018
32a1206
Add non-zero test case for creating a data channel with maxPacketLife…
lgrahl Apr 8, 2018
b86327a
Add test case for createDataChannel with maxPacketLifeTime and maxRet…
lgrahl Apr 8, 2018
ae1a97a
Fix the ondatachannel event test (don't set the ID, fix ID comparison…
lgrahl Apr 8, 2018
42240d8
Add test for default data channel configuration sync for the 'ondatac…
lgrahl Apr 8, 2018
0d2e28e
Add test for in-band negotiation of a data channel with a specific ID…
lgrahl Apr 9, 2018
8ec6602
Run all send/receive tests for negotiated channels as well
lgrahl Apr 9, 2018
ce28e05
Run all send/receive tests for negotiated asymmetric channels as well
lgrahl Apr 9, 2018
3342dba
Add RTCDataChannel.maxRetransmitTime member to historical
lgrahl Apr 9, 2018
44b5417
Split "closing the peer connection should close all channels" test in…
lgrahl Apr 9, 2018
853f116
Update exhausting channel IDs with one peer test to create 66535 data…
lgrahl Apr 9, 2018
205b39a
Add todo note for https://github.com/w3c/webrtc-pc/issues/1829
lgrahl Apr 9, 2018
c3b55b9
Add test for channel ID reuse after a former data channel with the sa…
lgrahl Apr 9, 2018
75658d5
Split onopen test case into local and remote (for in-band negotiated …
lgrahl Apr 11, 2018
13a886e
Add test for sending a message on the remote side (where the channel …
lgrahl Apr 11, 2018
47bf993
Add test for sending 16 KiB x64 and check if it is being received
lgrahl Apr 11, 2018
93d9f87
Add tests for sending after a channel (or a peer connection) has been…
lgrahl Apr 11, 2018
7919b3f
Add a test that ensures the initial .bufferedAmount value is zero for…
lgrahl Apr 11, 2018
b37ba46
Add test for data channel buffered amount after closing a channel or …
lgrahl Apr 11, 2018
b4d8cc0
Add test cases for sending all TypedArray types
lgrahl Apr 11, 2018
7bcbcef
Split send after close (channel and peer connection) into local and r…
lgrahl Apr 11, 2018
42bbfb9
Add data channel test case where both peers send simultaneously
lgrahl Apr 12, 2018
d1ca251
Add data channel test case for ensuring an ordered data channel is or…
lgrahl Apr 12, 2018
528ea03
Enhance descriptions of some test cases
lgrahl Apr 12, 2018
5de34a6
Fix SCTP transport constructor tests
lgrahl Apr 12, 2018
37b6557
Add a short stress test for data channel sending/receiving
lgrahl Apr 13, 2018
e885c51
Add license since some of the data channel tests are based on or insp…
lgrahl Apr 13, 2018
d15ee5d
Add data channel send tests for `null` and `undefined`
lgrahl Apr 19, 2018
5d97a94
Update all data channel tests to use async/await
lgrahl May 9, 2018
0b1288b
Update `datachannel` event tests for https://github.com/w3c/webrtc-pc…
lgrahl May 9, 2018
06974b4
Add a test based on discussion in https://github.com/w3c/webrtc-pc/pu…
lgrahl May 19, 2018
d0eb5c4
Remove invalid *negotiated true and no id* test case
lgrahl May 19, 2018
7eca2a0
Add RTCDataChannel-binaryType test file
lgrahl May 20, 2018
e88f65a
Remove a test case that is invalid now since https://github.com/w3c/w…
lgrahl May 20, 2018
e92ed40
Add the number 42 to the list of invalid types when sending a data ch…
lgrahl May 20, 2018
0d56280
Fix missing local timeout
lgrahl May 23, 2018
2c48917
Add an ugly workaround for createDataChannelPair to make it work in S…
lgrahl May 23, 2018
ab8b310
Increase timeout for channel exhaustion tests
lgrahl May 23, 2018
d7bf409
Fix assert_unreached description
lgrahl May 28, 2018
547b006
Fix missing attribute check and a typo in RTCPeerConnection-ondatacha…
lgrahl May 30, 2018
8d29c80
Fix a typo
lgrahl Jun 2, 2018
4837794
Fix test description
lgrahl Jun 2, 2018
99bd7d9
Make sure to skip at least a task in the `datachannel` then `open` ev…
lgrahl Aug 4, 2018
188d507
Fix bufferedamountlow event test
lgrahl Aug 4, 2018
2106a86
Update Resolver class to extend a Promise
lgrahl Oct 13, 2018
4ed8674
Minor fixes after rebasing
lgrahl Oct 13, 2018
0ccfa92
Make the linter happy
lgrahl Oct 13, 2018
305373c
Add readme file to WebRTC test suite and provide attribution
lgrahl Oct 21, 2018
04639f2
Update readme (attribution -> acknowledgements)
lgrahl Nov 4, 2018
cab92a7
Update readme (licensing stuff)
lgrahl Nov 4, 2018
e1fc283
Remove timeouts from .binaryType tests
lgrahl Nov 4, 2018
8519923
Make human linters happy
lgrahl Nov 4, 2018
99d792a
Fix RTCDataChannel-close `nCloses` vs. `nChannels` comparison
lgrahl Nov 4, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions webrtc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# WebRTC

This directory contains the WebRTC test suite.

## Acknowledgements

Some data channel tests are based on the [data channel conformance test
suite][nplab-webrtc-dc-playground] of the Network Programming Lab of the Münster
University of Applied Sciences. We would like to thank Peter Titz, Felix Weinrank and Timo
Völker for agreeing to contribute their test cases to this repository.

[nplab-webrtc-dc-playground]: https://github.com/nplab/WebRTC-Data-Channel-Playground/tree/master/conformance-tests
61 changes: 61 additions & 0 deletions webrtc/RTCDataChannel-binaryType.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!doctype html>
<meta charset=utf-8>
<title>RTCDataChannel.prototype.binaryType</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="RTCPeerConnection-helper.js"></script>
<script>
'use strict';

// Test is based on the following revision:
// https://rawgit.com/w3c/webrtc-pc/1cc5bfc3ff18741033d804c4a71f7891242fb5b3/webrtc.html

/*
6.2. RTCDataChannel
interface RTCDataChannel : EventTarget {
...
attribute DOMString binaryType;
...
};
*/

const validBinaryTypes = ['blob', 'arraybuffer'];
const invalidBinaryTypes = ['jellyfish', 'arraybuffer '];

/*
6.2. RTCDataChannel
binaryType
The binaryType attribute MUST, on getting, return the value to which it was last
set. On setting, if the new value is either the string "blob" or the string
"arraybuffer", then set the IDL attribute to this new value. Otherwise, throw a
SyntaxError. When an RTCDataChannel object is created, the binaryType attribute
MUST be initialized to the string "blob".
*/
for (const binaryType of validBinaryTypes) {
test((t) => {
const pc = new RTCPeerConnection();
const dc = pc.createDataChannel('test-binary-type');

dc.binaryType = binaryType;
assert_equals(dc.binaryType, binaryType, `dc.binaryType should be '${binaryType}'`);
}, `Setting binaryType to '${binaryType}' should succeed`);
}

for (const binaryType of invalidBinaryTypes) {
test((t) => {
const pc = new RTCPeerConnection();
const dc = pc.createDataChannel('test-binary-type');

assert_throws('SyntaxError', () => {
dc.binaryType = binaryType;
});
}, `Setting invalid binaryType '${binaryType}' should throw SyntaxError`);
}

/*
The default value of 'binaryType' is tested in RTCPeerConnection-createDataChannel.

Aspects on switching on 'binaryType' when receiving have been covered in
RTCDataChannel-send-receive.
*/
</script>
Loading