Skip to content
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

Merged
merged 2 commits into from
Apr 26, 2017

Conversation

alvestrand
Copy link
Contributor

@alvestrand alvestrand commented Jan 3, 2017

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 Reviewable

This is a skeleton that can be extended for any number of tests.
It passes on Chrome Canary with the "experimental features" flag set.
@wpt-pr-bot
Copy link
Collaborator

@alvestrand
Copy link
Contributor Author

@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.
Copy link
Contributor

@henbos henbos left a 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);
Copy link
Contributor

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()
Copy link
Contributor

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');
Copy link
Contributor

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.)

@agouaillard agouaillard merged commit c98a3f6 into web-platform-tests:master Apr 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants