Skip to content

Commit 49cbd6c

Browse files
Merge pull request #763 from fippo/electron-test
test: add electron testing
2 parents d8ea051 + ac92fdb commit 49cbd6c

File tree

6 files changed

+109
-3
lines changed

6 files changed

+109
-3
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ env:
2222
- BROWSER=firefox BVER=beta
2323
- BROWSER=firefox BVER=nightly
2424
- BROWSER=firefox BVER=esr
25+
- BROWSER=Electron
2526

2627
matrix:
2728
fast_finish: true
@@ -35,6 +36,7 @@ before_script:
3536
- export FIREFOX_BIN=browsers/bin/firefox-${BVER}
3637
- sh -e /etc/init.d/xvfb start
3738
- pulseaudio --start
39+
- if [ "$BROWSER" = "Electron" ]; then npm i karma-electron electron; fi
3840

3941
script:
4042
- node_modules/.bin/grunt

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@
5252
"sinon": "^2.2.0",
5353
"sinon-chai": "^2.14.0",
5454
"tape": "^4.0.0",
55-
"travis-multirunner": "^4.0.0"
55+
"travis-multirunner": "^4.4.0"
5656
}
5757
}

test/e2e/expectations/Electron

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
PASS addIceCandidate after setRemoteDescription resolves when called with null
2+
PASS addIceCandidate after setRemoteDescription resolves when called with undefined
3+
PASS addTrack throws an exception if the track has already been added
4+
PASS addTrack throws an exception if the track has already been added via addStream
5+
PASS addTrack throws an exception if addStream is called with a stream containing a track already added
6+
PASS addTrack throws an exception if the peerconnection has been closed already
7+
PASS addTrack and getSenders creates a sender
8+
PASS addTrack and getLocalStreams returns a stream with audio and video even if just an audio track was added
9+
PASS addTrack and getLocalStreams adds another track to the same stream
10+
PASS addTrack and getLocalStreams plays together nicely
11+
PASS window.adapter exists
12+
PASS window.adapter browserDetails exists
13+
PASS window.adapter browserDetails detects a browser type
14+
PASS window.adapter browserDetails detects a browser version
15+
PASS establishes a connection with legacy callbacks
16+
PASS establishes a connection with promises
17+
PASS establishes a connection with streams in both directions
18+
PASS establishes a connection with no explicit end-of-candidates
19+
PASS establishes a connection and calls the video loadedmetadata
20+
PASS establishes a connection with addTrack and all tracks of a stream
21+
PASS establishes a connection with addTrack but only the audio track of an av stream
22+
PASS establishes a connection with addTrack as two streams
23+
PASS establishes a connection with datachannel establishes a connection
24+
PASS URL.createObjectURL shim works for audio using src=
25+
PASS URL.createObjectURL shim works for audio using setAttribute
26+
PASS URL.createObjectURL shim works for video using src=
27+
PASS URL.createObjectURL shim works for video using setAttribute
28+
PASS dtmf RTCRtpSender.dtmf exists on audio senders
29+
PASS dtmf RTCRtpSender.dtmf does not exist on video senders
30+
PASS dtmf inserts DTMF when using addStream
31+
PASS dtmf inserts DTMF when using addTrack
32+
PASS getStats returns a Promise
33+
PASS getStats resolves the Promise with a Map(like)
34+
PASS getUserMedia navigator.getUserMedia exists
35+
PASS getUserMedia navigator.getUserMedia calls the callback
36+
PASS maxMessageSize sctp attribute exists
37+
PASS maxMessageSize sctp attribute is null before offer/answer
38+
PASS maxMessageSize sctp attribute is null if SCTP not negotiated
39+
PASS maxMessageSize sctp and maxMessageSize set if SCTP negotiated
40+
PASS maxMessageSize send largest possible single message
41+
PASS maxMessageSize throws an exception if the message is too large
42+
PASS maxMessageSize throws an exception if the message is too large (using a secondary data channel)
43+
PASS maxMessageSize is as expected for chrome>=0 and chrome>=0 -> 65536
44+
PASS maxMessageSize is as expected for chrome>=0 and firefox<=56 -> 65536
45+
PASS maxMessageSize is as expected for chrome>=0 and firefox>=57 -> 65536
46+
PASS maxMessageSize is as expected for chrome>=0 and 64 KiB -> 65536
47+
PASS maxMessageSize is as expected for chrome>=0 and 1.5 GiB -> 65536
48+
PASS maxMessageSize is as expected for chrome>=0 and 2 GiB -> 65536
49+
PASS maxMessageSize is as expected for chrome>=0 and Unlimited -> 65536
50+
PASS navigator.mediaDevices exists
51+
PASS navigator.mediaDevices is an EventTarget
52+
PASS navigator.mediaDevices implements the devicechange event
53+
PASS navigator.mediaDevices getUserMedia exists
54+
PASS navigator.mediaDevices getUserMedia fulfills the promise
55+
PASS navigator.mediaDevices enumerateDevices exists
56+
PASS navigator.mediaDevices enumerateDevices returns an array of devices
57+
PASS navigator.mediaDevices enumerateDevices returns some audioinput devices
58+
PASS navigator.mediaDevices enumerateDevices returns some videoinput devices
59+
PASS navigator.mediaDevices enumerateDevices returns some audiooutput devices
60+
PASS MediaStream window.MediaStream exists
61+
PASS MSID signals stream ids
62+
PASS MSID puts the track msid attribute into the localDescription
63+
PASS track event RTCPeerConnection.prototype.ontrack exists
64+
PASS track event is called when setRemoteDescription adds a new track to an existing stream
65+
PASS track event is called by setRemoteDescription track event
66+
PASS track event is called by setRemoteDescription ontrack
67+
PASS track event the event has a track
68+
PASS track event the event has a set of streams
69+
PASS track event the event has a receiver that is contained in the set of receivers
70+
PASS track event the event has a transceiver that has a receiver
71+
PASS removeTrack allows removeTrack twice
72+
PASS removeTrack throws an exception if the argument is a track, not a sender
73+
PASS removeTrack throws an exception if the sender does not belong to the peerconnection
74+
PASS removeTrack throws an exception if the peerconnection has been closed already
75+
PASS removeTrack after addStream for an audio/video track after removing a single track only a single sender with a track remains
76+
PASS removeTrack after addStream for an audio/video track after removing a single track the local stream remains untouched
77+
PASS removeTrack after addStream for an audio/video track after removing all tracks no senders with tracks remain
78+
PASS removeTrack after addStream for an audio/video track after removing all tracks no local streams remain
79+
PASS removeTrack after addTrack for an audio/video track after removing a single track only a single sender with a track remains
80+
PASS removeTrack after addTrack for an audio/video track after removing a single track the local stream remains untouched
81+
PASS removeTrack after addTrack for an audio/video track after removing all tracks no senders with tracks remain
82+
PASS removeTrack after addTrack for an audio/video track after removing all tracks no local streams remain
83+
PASS RTCIceCandidate window.RTCIceCandidate exists
84+
PASS RTCIceCandidate is augmented in the onicecandidate callback
85+
PASS RTCIceCandidate is augmented in the icecandidate event
86+
PASS RTCIceCandidate icecandidate eventlistener can be removed
87+
PASS RTCPeerConnection window.RTCPeerConnection exists
88+
PASS RTCPeerConnection constructor works
89+
PASS RTCPeerConnection getSenders exists
90+
PASS RTCPeerConnection generateCertificate is a static method
91+
PASS RTCPeerConnection icegatheringstatechange fires the event
92+
PASS RTCPeerConnection icegatheringstatechange calls the event handler
93+
PASS RTCSessionDescription window.RTCSessionDescription exists
94+
PASS srcObject setting from another object works
95+
PASS srcObject setter triggers loadedmetadata (audio)
96+
PASS srcObject getter returns the stream (audio)
97+
PASS srcObject setter triggers loadedmetadata (video)
98+
PASS srcObject getter returns the stream (video)

test/e2e/expectations/chrome-beta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ PASS URL.createObjectURL shim works for video using setAttribute
2828
PASS dtmf RTCRtpSender.dtmf exists on audio senders
2929
PASS dtmf RTCRtpSender.dtmf does not exist on video senders
3030
PASS dtmf inserts DTMF when using addStream
31-
PASS dtmf inserts DTMF when using addTrack
31+
ERR dtmf inserts DTMF when using addTrack timeout
3232
PASS getStats returns a Promise
3333
PASS getStats resolves the Promise with a Map(like)
3434
PASS getUserMedia navigator.getUserMedia exists

test/e2e/expectations/chrome-beta-no-experimental

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ PASS URL.createObjectURL shim works for video using setAttribute
2828
PASS dtmf RTCRtpSender.dtmf exists on audio senders
2929
PASS dtmf RTCRtpSender.dtmf does not exist on video senders
3030
PASS dtmf inserts DTMF when using addStream
31-
PASS dtmf inserts DTMF when using addTrack
31+
ERR dtmf inserts DTMF when using addTrack timeout
3232
PASS getStats returns a Promise
3333
PASS getStats resolves the Promise with a Map(like)
3434
PASS getUserMedia navigator.getUserMedia exists

test/karma.conf.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ if (process.env.BROWSER) {
1616
browsers = ['Edge'];
1717
} else if (process.env.BROWSER === 'safari') {
1818
browsers = ['Safari'];
19+
} else if (process.env.BROWSER === 'Electron') {
20+
browsers = ['electron'];
1921
} else {
2022
browsers = [process.env.BROWSER];
2123
}
@@ -83,6 +85,10 @@ module.exports = function(config) {
8385
base: 'Chrome',
8486
flags: chromeFlags
8587
},
88+
electron: {
89+
base: 'Electron',
90+
flags: ['--use-fake-device-for-media-stream']
91+
},
8692
firefox: {
8793
base: 'Firefox',
8894
prefs: {

0 commit comments

Comments
 (0)