Test adding and removing tracks.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS stream1.active is true
PASS stream1.getAudioTracks().length is 1
PASS stream1.getVideoTracks().length is 1
PASS stream2.active is true
PASS stream2.getAudioTracks().length is 1
PASS stream2.getVideoTracks().length is 1

*** remove an audio track
PASS stream1.getAudioTracks().length is 0
PASS stream1.getTrackById(audioTrack.id) is null

*** remove a non-existent (already removed) track (should not throw)

*** add the track back to the stream

*** remove a video track
PASS stream1.getVideoTracks().length is 0
PASS stream1.getTrackById(videoTrack.id) is null

*** remove a non-existent (already removed) track (should not throw)

*** add the track back to the stream

*** verify added tracks
PASS stream1.getAudioTracks().length is 1
PASS stream1.getVideoTracks().length is 1
PASS stream1.getAudioTracks()[0].kind is audioTrack.kind
PASS stream1.getAudioTracks()[0].label is audioTrack.label
PASS stream1.getVideoTracks()[0].kind is videoTrack.kind
PASS stream1.getVideoTracks()[0].label is videoTrack.label

*** try adding a stream's own tracks again (nothing should happen)
PASS stream1.getAudioTracks().length is 1
PASS stream1.getVideoTracks().length is 1

*** add tracks from another stream

*** verify added tracks
PASS stream1.getAudioTracks().length is 2
PASS stream1.getVideoTracks().length is 2

*** remove all tracks, stream will become inactive
PASS stream2.getAudioTracks().length is 0
PASS stream2.getVideoTracks().length is 0

*** active attribute is still true (until event is fired)
PASS stream2.active is true

Stream2 is inactive.
PASS stream2.active is false

*** add non-ended track
PASS audioTrack.readyState is not "ended"

*** active attribute is still false (until event is fired)
PASS stream2.active is false

Stream2 is active.
PASS stream2.active is true
PASS successfullyParsed is true

TEST COMPLETE

