Commit 15d774ed authored by Henrik Boström's avatar Henrik Boström Committed by Commit Bot

Fix RTCPeerConnection-track-stats.https.html flake.

The assert_object_equals would fail due to timestamps being different in
rare runs where the getStats() cache was invalidated between the two
calls.

external/wpt/webrtc should make no assumptions about any cache. Tests
are updated only to compare stats IDs, not individual metrics.

Bug: 829401
Change-Id: I6fcc781a1827af69f47a5c4416dd5e6bae0c98b3
Reviewed-on: https://chromium-review.googlesource.com/999477Reviewed-by: default avatarHarald Alvestrand <hta@chromium.org>
Commit-Queue: Henrik Boström <hbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548721}
parent f6638107
...@@ -483,13 +483,14 @@ ...@@ -483,13 +483,14 @@
let senderReport = await sender.getStats(); let senderReport = await sender.getStats();
let trackReport = await caller.getStats(sender.track); let trackReport = await caller.getStats(sender.track);
// Verify the same stats objects are returned but don't compare each
// individual metric because timestamps and counters could have gone up
// between the two getStats() calls.
senderReport.forEach(senderReportStat => { senderReport.forEach(senderReportStat => {
let trackReportStat = trackReport.get(senderReportStat.id); assert_true(trackReport.has(senderReportStat.id));
assert_object_equals(trackReportStat, senderReportStat);
}); });
trackReport.forEach(trackReportStat => { trackReport.forEach(trackReportStat => {
let senderReportStat = senderReport.get(trackReportStat.id); assert_true(senderReport.has(trackReportStat.id));
assert_object_equals(senderReportStat, trackReportStat);
}); });
}, 'RTCPeerConnection.getStats(sendingTrack) is the same as ' + }, 'RTCPeerConnection.getStats(sendingTrack) is the same as ' +
'RTCRtpSender.getStats()'); 'RTCRtpSender.getStats()');
...@@ -508,13 +509,14 @@ ...@@ -508,13 +509,14 @@
let receiverReport = await receiver.getStats(); let receiverReport = await receiver.getStats();
let trackReport = await caller.getStats(receiver.track); let trackReport = await caller.getStats(receiver.track);
// Verify the same stats objects are returned but don't compare each
// individual metric because timestamps and counters could have gone up
// between the two getStats() calls.
receiverReport.forEach(receiverReportStat => { receiverReport.forEach(receiverReportStat => {
let trackReportStat = trackReport.get(receiverReportStat.id); assert_true(trackReport.has(receiverReportStat.id));
assert_object_equals(trackReportStat, receiverReportStat);
}); });
trackReport.forEach(trackReportStat => { trackReport.forEach(trackReportStat => {
let receiverReportStat = receiverReport.get(trackReportStat.id); assert_true(receiverReport.has(trackReportStat.id));
assert_object_equals(receiverReportStat, trackReportStat);
}); });
}, 'RTCPeerConnection.getStats(receivingTrack) is the same as ' + }, 'RTCPeerConnection.getStats(receivingTrack) is the same as ' +
'RTCRtpReceiver.getStats()'); 'RTCRtpReceiver.getStats()');
......
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