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

Unified Diff: tools/perf/metrics/webrtc_stats_unittest.py

Issue 2561603003: Add encoding time and and fps to webrtc.stress case. (Closed)
Patch Set: Don't log more than 5 conns 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 | « tools/perf/metrics/webrtc_stats.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/metrics/webrtc_stats_unittest.py
diff --git a/tools/perf/metrics/webrtc_stats_unittest.py b/tools/perf/metrics/webrtc_stats_unittest.py
index d24b130042f0adbc8dc85633aa639888e9ef744a..b6f3488566e4d21f92786377a8124e4f15ab3e58 100644
--- a/tools/perf/metrics/webrtc_stats_unittest.py
+++ b/tools/perf/metrics/webrtc_stats_unittest.py
@@ -107,9 +107,7 @@ class FakeResults(object):
class WebRtcStatsUnittest(unittest.TestCase):
- def _RunMetricOnJson(self, json_to_return):
- stats_metric = webrtc_stats.WebRtcStatisticsMetric()
-
+ def _RunMetricOnJson(self, json_to_return, stats_metric):
tab = simple_mock.MockObject()
page = simple_mock.MockObject()
@@ -125,7 +123,8 @@ class WebRtcStatsUnittest(unittest.TestCase):
return results
def testExtractsValuesAsTimeSeries(self):
- results = self._RunMetricOnJson(SAMPLE_JSON)
+ stats_metric = webrtc_stats.WebRtcStatisticsMetric()
+ results = self._RunMetricOnJson(SAMPLE_JSON, stats_metric)
self.assertTrue(results.received_values,
'Expected values for googDecodeMs and others, got none.')
@@ -139,7 +138,8 @@ class WebRtcStatsUnittest(unittest.TestCase):
[100.0, 101.0])
def testExtractsInterestingMetricsOnly(self):
- results = self._RunMetricOnJson(SAMPLE_JSON)
+ stats_metric = webrtc_stats.WebRtcStatisticsMetric()
+ results = self._RunMetricOnJson(SAMPLE_JSON, stats_metric)
self.assertTrue(len(results.received_values) > 0)
self.assertIn('peer_connection_0', results.received_values[0].name,
@@ -159,6 +159,20 @@ class WebRtcStatsUnittest(unittest.TestCase):
'should not be reported since it is not interesting.')
self.assertNotIn('peer_connection_1_audio_audio_input_level', all_names)
+ def testExtractsParticularMetricsOnlyIfSpecified(self):
+ only_goog_rtt_and_max_decode = ['googRtt', 'googMaxDecodeMs']
+ stats_metric = webrtc_stats.WebRtcStatisticsMetric(
+ particular_metrics=only_goog_rtt_and_max_decode)
+ results = self._RunMetricOnJson(SAMPLE_JSON, stats_metric)
+
+ received_names = [value.name for value in results.received_values]
+ expected_names = ['peer_connection_0_audio_goog_rtt',
+ 'peer_connection_0_video_goog_rtt',
+ 'peer_connection_1_video_goog_max_decode_ms',
+ 'peer_connection_1_video_goog_rtt']
+ self.assertEqual(expected_names, received_names)
+
def testReturnsIfJsonIsEmpty(self):
- results = self._RunMetricOnJson('[]')
+ stats_metric = webrtc_stats.WebRtcStatisticsMetric()
+ results = self._RunMetricOnJson('[]', stats_metric)
self.assertFalse(results.received_values)
« no previous file with comments | « tools/perf/metrics/webrtc_stats.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698