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 | 7 from telemetry.unittest_util import simple_mock |
8 | 8 |
9 from metrics import webrtc_stats | 9 from metrics import webrtc_stats |
10 | 10 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 { | 80 { |
81 "googAvailableSendBandwidth":"40000", | 81 "googAvailableSendBandwidth":"40000", |
82 "googAvailableRecvBandwidth":"22345", | 82 "googAvailableRecvBandwidth":"22345", |
83 "googTargetEncBitrate":"20000" | 83 "googTargetEncBitrate":"20000" |
84 } | 84 } |
85 ] | 85 ] |
86 ]] | 86 ]] |
87 ''' | 87 ''' |
88 | 88 |
89 | 89 |
90 class FakeResults: | 90 class FakeResults(object): |
91 def __init__(self, current_page): | 91 def __init__(self, current_page): |
92 self._received_values = [] | 92 self._received_values = [] |
93 self._current_page = current_page | 93 self._current_page = current_page |
94 | 94 |
95 @property | 95 @property |
96 def received_values(self): | 96 def received_values(self): |
97 return self._received_values | 97 return self._received_values |
98 | 98 |
99 @property | 99 @property |
100 def current_page(self): | 100 def current_page(self): |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 # from video reports (even though audio_input_level is quite obvious). | 154 # from video reports (even though audio_input_level is quite obvious). |
155 self.assertNotIn('peer_connection_0_audio_audio_input_level', all_names, | 155 self.assertNotIn('peer_connection_0_audio_audio_input_level', all_names, |
156 'Input level is in the JSON for both connections but ' | 156 'Input level is in the JSON for both connections but ' |
157 'should not be reported since it is not interesting.') | 157 'should not be reported since it is not interesting.') |
158 self.assertNotIn('peer_connection_1_audio_audio_input_level', all_names) | 158 self.assertNotIn('peer_connection_1_audio_audio_input_level', all_names) |
159 | 159 |
160 def testReturnsIfJsonIsEmpty(self): | 160 def testReturnsIfJsonIsEmpty(self): |
161 results = self._RunMetricOnJson('[]') | 161 results = self._RunMetricOnJson('[]') |
162 self.assertFalse(results.received_values) | 162 self.assertFalse(results.received_values) |
163 | 163 |
OLD | NEW |