-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Adds a basic function check for GetStats #4499
Adds a basic function check for GetStats #4499
Conversation
This is a skeleton that can be extended for any number of tests. It passes on Chrome Canary with the "experimental features" flag set.
Notifying @alvestrand, @dontcallmedom, and @phoglund. (Learn how reviewing works.) |
@henbos please take a look - it seems like an easy way to check on Firefox compatibility. |
This allows much more interesting tests to be written, since more of the stats are populated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
let sessionStat = getStatsRecordByType(report, 'peer-connection'); | ||
assert_not_equals(sessionStat, null, 'Did not find peer-connection stats'); | ||
assert_exists(sessionStat, 'dataChannelsOpened'); | ||
assert_equals(sessionStat.dataChannelsOpened, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Wouldn't it make more sense to call sessionStats peerConnectionStats?
if (gFirstConnection.iceConnectionState != 'connected') { | ||
return; | ||
} | ||
gFirstConnection.getStats() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A follow-up CL should add one using the selector argument, though that would require tracks.
assert_not_equals(report, null); | ||
let sessionStat = getStatsRecordByType(report, 'peer-connection'); | ||
assert_not_equals(sessionStat, null, 'Did not find peer-connection stats'); | ||
assert_exists(sessionStat, 'dataChannelsOpened'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Sweet, this does not have to be updated even if w3c/webrtc-stats#125 lands.)
This is a skeleton that can be extended for any number of tests.
It passes on Chrome Canary with the "experimental features" flag set.
This change is