Commit bb6b1ac7 authored by Seth Hampson's avatar Seth Hampson Committed by Commit Bot

Re-enabling previously failing addTrack() tests.

The WebRTC change has rolled in that these 2 tests were disabled for.
One is being re-enabled and updated to pass, while the other is being
removed because it is no longer relevant.

Bug: webrtc:7932, webrtc:7933
Change-Id: Ia0a9f61997a1640c37fdc8e632f28543169b2161
Reviewed-on: https://chromium-review.googlesource.com/995961Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Commit-Queue: Henrik Boström <hbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548726}
parent f8afa420
......@@ -397,37 +397,11 @@ IN_PROC_BROWSER_TEST_F(WebRtcRtpBrowserTest,
left_tab_));
}
// This test is disabled to allow WebRTC change to roll in that adds support
// for multiple/no streams for a given track in Unified Plan mode. Currently the
// correct behavior is not tested when the stream switches, and since the WebRTC
// change adds some (more) correct behavior for this in Plan B mode it breaks.
// This test will be updated after the roll in to test that the original track
// gets muted and the original stream is empty after the stream switches.
// bug: https://bugs.chromium.org/p/webrtc/issues/detail?id=7933
IN_PROC_BROWSER_TEST_F(WebRtcRtpBrowserTest, DISABLED_TrackSwitchingStream) {
IN_PROC_BROWSER_TEST_F(WebRtcRtpBrowserTest, TrackSwitchingStream) {
StartServerAndOpenTabs();
EXPECT_EQ("ok", ExecuteJavascript("trackSwitchingStream()", left_tab_));
}
// This test is disabled to allow WebRTC change to roll in that adds support
// for multiple/no streams for a given track in Unified Plan mode. This
// test breaks with the update because the SDP is parsed differently to support
// multiple a=msid lines and for Plan B mode only the first media stream ID is
// used. Currently this doesn't test the desired behavior, because the SDP
// parsing uses the last a=msid line, which ends up just testing the stream
// switching (as tested above already). Once the update is rolled in we can
// either:
// A: Remove this test because it only can be done with SDP munging, and it is
// not supported with Plan B SDP semantics.
// B: Test this case for Unified Plan, assuming SDP munging. In this case
// according to the w3 WebRTC spec we will not add the new stream.
// bug: https://bugs.chromium.org/p/webrtc/issues/detail?id=7933
IN_PROC_BROWSER_TEST_F(WebRtcRtpBrowserTest,
DISABLED_TrackAddedToSecondStream) {
StartServerAndOpenTabs();
EXPECT_EQ("ok", ExecuteJavascript("trackAddedToSecondStream()", left_tab_));
}
IN_PROC_BROWSER_TEST_F(WebRtcRtpBrowserTest,
RTCRtpSenderReplaceTrackSendsNewVideoTrack) {
StartServer();
......
......@@ -344,70 +344,39 @@ function switchRemoteStreamWithoutWaitingForPromisesToResolve() {
// TODO(hbos): Make this a web platform test instead. https://crbug.com/773472
function trackSwitchingStream() {
let pc = new RTCPeerConnection();
let track1 = null;
let track = null;
let stream1 = null;
let stream2 = null;
pc.setRemoteDescription(createOffer([msid('stream1', 'track1')]));
pc.ontrack = (e) => {
track1 = e.track;
track = e.track;
stream1 = e.streams[0];
if (stream1.getTracks()[0] != track1)
throw failTest('stream1 does not contain track1.');
if (stream1.getTracks()[0] != track)
throw failTest('stream1 does not contain track.');
// This should update the associated set of streams for the existing
// receiver for track1.
pc.setRemoteDescription(createOffer([msid('stream2', 'track1')]));
// receiver for track.
pc.setRemoteDescription(createOffer([msid('stream2', 'track')]));
pc.ontrack = (e) => {
let originalTrack1 = track1;
track1 = e.track;
let originalTrack = track;
track = e.track;
stream2 = e.streams[0];
// TODO(hbos): A new track should not be created, track1 should simply
// TODO(hbos): A new track should not be created, track should simply
// move. Fix this and update assertion. https://crbug.com/webrtc/8377
if (track1 == originalTrack1)
if (track == originalTrack)
throw failTest('A new track was not created.');
// TODO(hbos): stream1 should now be empty and track1 muted. Fix this and
// update assertions. https://crbug.com/773523
if (stream1.getTracks()[0] != originalTrack1)
throw failTest('stream1 does not still contain the original track1.');
if (track1.muted)
throw failTest('The original track1 has been muted.');
if (stream2.getTracks()[0] != track1)
throw failTest('stream2 does not contain track1.');
if (stream1.getTracks().length != 0)
throw failTest('stream1 is not empty.')
if (!originalTrack.muted)
throw failTest('Original track is not muted.');
if (track.muted)
throw failTest('New track is muted.');
if (stream2.getTracks()[0] != track)
throw failTest('stream2 does not contain track.');
returnToTest('ok');
};
};
}
// TODO(hbos): Make this a web platform test instead. https://crbug.com/773472
function trackAddedToSecondStream() {
let pc = new RTCPeerConnection();
let track1 = null;
let track2 = null;
let stream1 = null;
let stream2 = null;
pc.ontrack = (e) => {
track1 = e.track;
stream1 = e.streams[0];
if (stream1.getTracks()[0] != track1)
throw failTest('stream1 does not contain track1.');
pc.ontrack = (e) => {
let originalTrack1 = track1;
track1 = e.track;
stream2 = e.streams[0];
// TODO(hbos): A new track should not be created, track1 should be added
// to both streams. Fix this and update assertion.
// https://crbug.com/webrtc/8377
if (track1 == originalTrack1)
throw failTest('A new track was not created.');
if (stream2.getTracks()[0] != track1)
throw failTest('stream2 does not contain track1.');
returnToTest('ok');
};
pc.setRemoteDescription(createOffer([ msid('stream1', 'track1'),
msid('stream2', 'track1') ]));
};
pc.setRemoteDescription(createOffer([msid('stream1', 'track1')]));
}
// TODO(hbos): Add a test that verifies a track that is added to two streams can
// be removed from just one of them. https://crbug.com/webrtc/8377
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment