Commit 83d546a2 authored by Harald Alvestrand's avatar Harald Alvestrand Committed by Commit Bot

Fix getStats test for RTPReceiver

The test for getStats() on an RTP receiver was testing with the wrong
track (sent track not received track).
The change gives a reasonable error message (not all stats are present).

Bug: none
Change-Id: I7f35dc90a2e4f6ee4ed67e8d6ae2ecdf9246c2a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2060952Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Commit-Queue: Harald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742094}
parent 9863ffc9
...@@ -10,7 +10,7 @@ PASS getStats() with no argument should return stats report containing peer-conn ...@@ -10,7 +10,7 @@ PASS getStats() with no argument should return stats report containing peer-conn
FAIL getStats() with no argument should return stats report containing peer-connection stats and outbound-track-stats assert_true: Expect statsReport to contain stats object of type outbound-rtp expected true got false FAIL getStats() with no argument should return stats report containing peer-connection stats and outbound-track-stats assert_true: Expect statsReport to contain stats object of type outbound-rtp expected true got false
FAIL getStats() with no argument should return stats for no-stream tracks assert_true: Expect statsReport to contain stats object of type outbound-rtp expected true got false FAIL getStats() with no argument should return stats for no-stream tracks assert_true: Expect statsReport to contain stats object of type outbound-rtp expected true got false
FAIL getStats() on track associated with RtpSender should return stats report containing outbound-rtp stats assert_equals: Expect dictionary.remoteId to be string expected "string" but got "undefined" FAIL getStats() on track associated with RtpSender should return stats report containing outbound-rtp stats assert_equals: Expect dictionary.remoteId to be string expected "string" but got "undefined"
FAIL getStats() on track associated with RtpReceiver should return stats report containing inbound-rtp stats promise_test: Unhandled rejection with value: object "InvalidAccessError: Failed to execute 'getStats' on 'RTCPeerConnection': There is no sender or receiver for the track." FAIL getStats() on track associated with RtpReceiver should return stats report containing inbound-rtp stats assert_equals: Expect dictionary.codecId to be string expected "string" but got "undefined"
FAIL getStats() with connected peer connections having tracks and data channel should return all mandatory to implement stats assert_unreached: test failed with error: Error: assert_true: Expect dictionary.dataChannelIdentifier to be integer expected true got false Reached unreachable code FAIL getStats() with connected peer connections having tracks and data channel should return all mandatory to implement stats assert_unreached: test failed with error: Error: assert_true: Expect dictionary.dataChannelIdentifier to be integer expected true got false Reached unreachable code
Harness: the test ran to completion. Harness: the test ran to completion.
...@@ -212,7 +212,8 @@ ...@@ -212,7 +212,8 @@
pc2.getReceivers()[0].track.addEventListener('unmute', resolve); pc2.getReceivers()[0].track.addEventListener('unmute', resolve);
}); });
} }
const stats = await pc2.getStats(track); const receivedTrack = pc2.getReceivers()[0].track;
const stats = await pc2.getStats(receivedTrack);
validateStatsReport(stats); validateStatsReport(stats);
assert_stats_report_has_stats(stats, ['inbound-rtp']); assert_stats_report_has_stats(stats, ['inbound-rtp']);
}, `getStats() on track associated with RtpReceiver should return stats report containing inbound-rtp stats`); }, `getStats() on track associated with RtpReceiver should return stats report containing inbound-rtp stats`);
......
...@@ -10,7 +10,7 @@ PASS getStats() with no argument should return stats report containing peer-conn ...@@ -10,7 +10,7 @@ PASS getStats() with no argument should return stats report containing peer-conn
FAIL getStats() with no argument should return stats report containing peer-connection stats and outbound-track-stats assert_true: Expect statsReport to contain stats object of type outbound-rtp expected true got false FAIL getStats() with no argument should return stats report containing peer-connection stats and outbound-track-stats assert_true: Expect statsReport to contain stats object of type outbound-rtp expected true got false
FAIL getStats() with no argument should return stats for no-stream tracks assert_true: Expect statsReport to contain stats object of type outbound-rtp expected true got false FAIL getStats() with no argument should return stats for no-stream tracks assert_true: Expect statsReport to contain stats object of type outbound-rtp expected true got false
FAIL getStats() on track associated with RtpSender should return stats report containing outbound-rtp stats assert_equals: Expect dictionary.remoteId to be string expected "string" but got "undefined" FAIL getStats() on track associated with RtpSender should return stats report containing outbound-rtp stats assert_equals: Expect dictionary.remoteId to be string expected "string" but got "undefined"
FAIL getStats() on track associated with RtpReceiver should return stats report containing inbound-rtp stats promise_test: Unhandled rejection with value: object "InvalidAccessError: Failed to execute 'getStats' on 'RTCPeerConnection': There is no sender or receiver for the track." FAIL getStats() on track associated with RtpReceiver should return stats report containing inbound-rtp stats assert_equals: Expect dictionary.codecId to be string expected "string" but got "undefined"
FAIL getStats() with connected peer connections having tracks and data channel should return all mandatory to implement stats assert_unreached: test failed with error: Error: assert_true: Expect dictionary.dataChannelIdentifier to be integer expected true got false Reached unreachable code FAIL getStats() with connected peer connections having tracks and data channel should return all mandatory to implement stats assert_unreached: test failed with error: Error: assert_true: Expect dictionary.dataChannelIdentifier to be integer expected true got false Reached unreachable code
Harness: the test ran to completion. Harness: the test ran to completion.
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