Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8723)

Unified Diff: chrome/test/data/webrtc/peerconnection_getstats.js

Issue 2534633002: Preparation CL for WebRTC performance test using promise-based getStats (Closed)
Patch Set: Rename RTCStats[Report]Dictionary to TestStats[Report]Dictionary Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webrtc/peerconnection_getstats.js
diff --git a/chrome/test/data/webrtc/peerconnection_getstats.js b/chrome/test/data/webrtc/peerconnection_getstats.js
index 9eea0b6e924bbbe8e6e04ef942f3361e6d84df7b..4a81978a509ccface3678249f71e9bf5f346975f 100644
--- a/chrome/test/data/webrtc/peerconnection_getstats.js
+++ b/chrome/test/data/webrtc/peerconnection_getstats.js
@@ -261,6 +261,29 @@ function verifyStatsGeneratedPromise() {
}
/**
+ * Gets the result of the promise-based |RTCPeerConnection.getStats| as a
+ * dictionary of RTCStats-dictionaries.
+ *
+ * Returns "ok-" followed by a JSON-stringified dictionary of dictionaries to
+ * the test.
+ */
+function getStatsReportDictionary() {
+ peerConnection_().getStats()
+ .then(function(report) {
+ if (report == null || report.size == 0)
+ throw new failTest('report is null or empty.');
+ let reportDictionary = {};
+ for (let stats of report.values()) {
+ reportDictionary[stats.id] = stats;
+ }
+ returnToTest('ok-' + JSON.stringify(reportDictionary));
+ },
+ function(e) {
+ throw failTest('Promise was rejected: ' + e);
+ });
+}
+
+/**
* Returns a complete list of whitelisted "RTCStats.type" values as a
* JSON-stringified array of strings to the test.
*/
« no previous file with comments | « chrome/test/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698