OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import unittest | 5 import unittest |
6 | 6 |
| 7 from telemetry.unittest_util import simple_mock |
| 8 |
7 from metrics import webrtc_stats | 9 from metrics import webrtc_stats |
8 from telemetry.unittest_util import simple_mock | |
9 | 10 |
10 | 11 |
11 SAMPLE_JSON = ''' | 12 SAMPLE_JSON = ''' |
12 [[ | 13 [[ |
13 [ | 14 [ |
14 { | 15 { |
15 "googFrameHeightInput":"480", | 16 "googFrameHeightInput":"480", |
16 "googFrameWidthInput":"640", | 17 "googFrameWidthInput":"640", |
17 "googFrameRateSent": "23", | 18 "googFrameRateSent": "23", |
18 "packetsLost":"-1", | 19 "packetsLost":"-1", |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 'peer_connection_1_video_goog_max_decode_ms') | 134 'peer_connection_1_video_goog_max_decode_ms') |
134 self.assertEqual(results.received_values[3].name, | 135 self.assertEqual(results.received_values[3].name, |
135 'peer_connection_1_video_packets_received') | 136 'peer_connection_1_video_packets_received') |
136 self.assertEqual(results.received_values[4].name, | 137 self.assertEqual(results.received_values[4].name, |
137 'peer_connection_1_video_goog_decode_ms') | 138 'peer_connection_1_video_goog_decode_ms') |
138 | 139 |
139 def testReturnsIfJsonIsEmpty(self): | 140 def testReturnsIfJsonIsEmpty(self): |
140 results = self._RunMetricOnJson('[]') | 141 results = self._RunMetricOnJson('[]') |
141 self.assertFalse(results.received_values) | 142 self.assertFalse(results.received_values) |
142 | 143 |
OLD | NEW |