OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 """Common utilities used in unit tests, within this directory.""" | 5 """Common utilities used in unit tests, within this directory.""" |
6 | 6 |
7 import dependency_graph | 7 import dependency_graph |
8 import devtools_monitor | 8 import devtools_monitor |
9 import loading_trace | 9 import loading_trace |
10 import page_track | 10 import page_track |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 214 |
215 def SyncRequest(self, method, params=None): | 215 def SyncRequest(self, method, params=None): |
216 """Mocked method.""" | 216 """Mocked method.""" |
217 expected_params, response = self._expected_responses[method].pop(0) | 217 expected_params, response = self._expected_responses[method].pop(0) |
218 if not self._expected_responses[method]: | 218 if not self._expected_responses[method]: |
219 del self._expected_responses[method] | 219 del self._expected_responses[method] |
220 self._test_case.assertEqual(expected_params, params) | 220 self._test_case.assertEqual(expected_params, params) |
221 return response | 221 return response |
222 | 222 |
223 | 223 |
224 class MockUserSatisfiedLens(user_satisfied_lens._UserSatisfiedLens): | 224 class MockUserSatisfiedLens(user_satisfied_lens._FirstEventLens): |
225 def _CalculateTimes(self, _): | 225 def _CalculateTimes(self, _): |
226 self._satisfied_msec = float('inf') | 226 self._satisfied_msec = float('inf') |
227 self._event_msec = float('inf') | 227 self._event_msec = float('inf') |
OLD | NEW |