9 Commits

Author SHA1 Message Date
hbos
b78306a7d3 Fix segfault when PeerConnection is destroyed during stats collection.
RTCStatsCollector relies on PeerConnection and its WebRtcSession. If the
PeerConnection is destroyed, reference counting keeps the
RTCStatsCollector alive until the request has completed. But the request
is using PeerConnection/WebRtcSession resources that are destroyed in
~PeerConnection().

To get around this problem, RTCStatsCollector::WaitForPendingRequest()
is added, which is invoked at ~PeerConnection().

Integration test added, it caused a segmentation fault before this
change / EXPECT failure.

BUG=chromium:627816

Review-Url: https://codereview.webrtc.org/2583613003
Cr-Commit-Position: refs/heads/master@{#15674}
2016-12-19 13:06:57 +00:00
hbos
3168c7a04b Rename RTCOutboundRTPStreamStats *_rtt members to *_round_trip_time.
The spec renamed these recently:
https://w3c.github.io/webrtc-stats/#since-21-sep-2016*

BUG=chromium:627816

Review-Url: https://codereview.webrtc.org/2576383002
Cr-Commit-Position: refs/heads/master@{#15630}
2016-12-15 14:17:15 +00:00
hbos
7bf5369763 RTCStatsIntegrationTest: TestMemberIsIDReference on all defined IDs.
This makes sure that the referenced stats dictionaries exist.

BUG=chromium:627816

Review-Url: https://codereview.webrtc.org/2577033002
Cr-Commit-Position: refs/heads/master@{#15628}
2016-12-15 11:33:42 +00:00
hbos
e10e6d1f47 RTCOutboundRTPStreamStats.roundTripTime: Only report non-negative values.
Underlying stats gatherers may otherwise default it to -1.

BUG=chromium:669877, chromium:627816

Review-Url: https://codereview.webrtc.org/2562703007
Cr-Commit-Position: refs/heads/master@{#15625}
2016-12-15 09:54:38 +00:00
hbos
e448dd5355 RTCIceCandidatePairStats.consentRequestsSent set by RTCStatsCollector
and requestsSent is updated.

Before:
  requestsSent = total ping requests
Now
  requestsSent = pings sent before first response
  consentRequestsSent = pings after first response

Spec: https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatepairstats-consentrequestssent

BUG=chromium:633550

Review-Url: https://codereview.webrtc.org/2558293002
Cr-Commit-Position: refs/heads/master@{#15541}
2016-12-12 09:22:59 +00:00
hbos
02cd4d6dfc RTCInboundRTPStreamStats.packetsLost set by RTCStatsCollector.
Spec: https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-packetslost

BUG=chromium:657855

Review-Url: https://codereview.webrtc.org/2559973002
Cr-Commit-Position: refs/heads/master@{#15507}
2016-12-09 12:19:50 +00:00
hbos
d82f5125b7 RTCIceCandidatePairStats.requestsReceived defined by RTCStatsCollector.
Spec: https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatepairstats-requestsreceived

BUG=chromium:633550

Review-Url: https://codereview.webrtc.org/2565463002
Cr-Commit-Position: refs/heads/master@{#15506}
2016-12-09 12:12:45 +00:00
hbos
0583b286e4 Collecting RTCIceCandidatePairStats.transport_id and improved unittests.
RTCIceCandidatePairStats.transport_id is set to the related
RTCTransportStats' id.

Unittest for RTCIceCandidatePairStats is updated to do EXPECT_EQ
between actual and an expected hardcoded dictionary. The previous way of
testing, ExpectReportContainsCandidatePair, is removed.

(ExpectReportContainsCandidate still exist, we might want to replace
this by EXPECT_EQ testing in a follow up.)

Unittest for RTCTransportStats is similarly updated and
ExpectReportContainsTransportStats is removed. A bug was uncovered where
the "rtcp_connection_info.best_connection = true" case was not tested
(a copy of rtcp_connection_info was used in the test, modifying that had
no affect on the test) - fixed.

rtcstats_integrationtest.cc updated to take transport_id into account.

In order to reuse an updated version of expected_rt[c]p_transport in the
unittest, timestamps are ignored by RTCStats::operator==.

BUG=chromium:627816, chromium:653873, chromium:653873, webrtc:6755

Review-Url: https://codereview.webrtc.org/2527113002
Cr-Commit-Position: refs/heads/master@{#15316}
2016-11-30 09:50:36 +00:00
hbos
db346a7cbe RTCStatsIntegrationTest added.
This is an integration test using peerconnectiontestwrapper.h to set up
and end to end test using a real PeerConnection implementation. These
tests will complement rtcstatscollector_unittest.cc which collects all
stats using mocks.

The integration test is set up so that all stats types are returned by
GetStats and verifies that expected dictionary members are defined. The
test could in the future be updated to include sanity checks for the
values of members. There is a sanity check that references to other
stats dictionaries yield existing stats of the appropriate type, but
other than that members are only tested for if they are defined not.

StatsCallback of rtcstatscollector_unittest.cc is moved so that it can
be reused and renamed to RTCStatsObtainer.

TODO: Audio stream track stats members are missing in the test. Find out
if this is because of a real problem or because of testing without real
devices. Do this before closing crbug.com/627816.

BUG=chromium:627816

Review-Url: https://codereview.webrtc.org/2521663002
Cr-Commit-Position: refs/heads/master@{#15287}
2016-11-29 09:57:08 +00:00