| 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 import mock | 5 import mock |
| 6 | 6 |
| 7 from common import chrome_dependency_fetcher | 7 from common import chrome_dependency_fetcher |
| 8 from common.dependency import DependencyRoll | 8 from common.dependency import DependencyRoll |
| 9 from crash import chromecrash_parser | 9 from crash import chromecrash_parser |
| 10 from crash import detect_regression_range | 10 from crash import detect_regression_range |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 'src/add': DependencyRoll('src/add', 'https://repo1', None, '2'), | 198 'src/add': DependencyRoll('src/add', 'https://repo1', None, '2'), |
| 199 'src/delete': DependencyRoll('src/delete', 'https://repo2', '2', | 199 'src/delete': DependencyRoll('src/delete', 'https://repo2', '2', |
| 200 None) | 200 None) |
| 201 }) | 201 }) |
| 202 | 202 |
| 203 dummy_suspect = Suspect(self.GetDummyChangeLog(), 'src/') | 203 dummy_suspect = Suspect(self.GetDummyChangeLog(), 'src/') |
| 204 self.mock(ChangelistClassifier, '__call__', | 204 self.mock(ChangelistClassifier, '__call__', |
| 205 lambda _self, report: | 205 lambda _self, report: |
| 206 [dummy_suspect] if report.regression_range else []) | 206 [dummy_suspect] if report.regression_range else []) |
| 207 | 207 |
| 208 self.mock(ComponentClassifier, 'Classify', lambda *_: []) | 208 self.mock(ComponentClassifier, 'ClassifySuspects', lambda *_: []) |
| 209 self.mock(ProjectClassifier, 'Classify', lambda *_: '') | 209 self.mock(ComponentClassifier, 'ClassifyCallStack', lambda *_: []) |
| 210 self.mock(ProjectClassifier, 'ClassifySuspects', lambda *_: '') |
| 211 self.mock(ProjectClassifier, 'ClassifyCallStack', lambda *_: '') |
| 210 | 212 |
| 211 # TODO(wrengr): for both these tests, we should compare Culprit | 213 # TODO(wrengr): for both these tests, we should compare Culprit |
| 212 # objects directly rather than calling ToDicts and comparing the | 214 # objects directly rather than calling ToDicts and comparing the |
| 213 # dictionaries. | 215 # dictionaries. |
| 214 self._testFindCulpritForChromeCrashSucceeds(dummy_suspect) | 216 self._testFindCulpritForChromeCrashSucceeds(dummy_suspect) |
| 215 self._testFindCulpritForChromeCrashFails() | 217 self._testFindCulpritForChromeCrashFails() |
| 216 | 218 |
| 217 def _testFindCulpritForChromeCrashSucceeds(self, dummy_suspect): | 219 def _testFindCulpritForChromeCrashSucceeds(self, dummy_suspect): |
| 218 analysis = CrashAnalysis() | 220 analysis = CrashAnalysis() |
| 219 analysis.signature = 'signature' | 221 analysis.signature = 'signature' |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 'feedback_url': ( | 285 'feedback_url': ( |
| 284 findit_for_chromecrash._FRACAS_FEEDBACK_URL_TEMPLATE % ( | 286 findit_for_chromecrash._FRACAS_FEEDBACK_URL_TEMPLATE % ( |
| 285 mocked_host, urlsafe_key)), | 287 mocked_host, urlsafe_key)), |
| 286 'other': 'data' | 288 'other': 'data' |
| 287 } | 289 } |
| 288 } | 290 } |
| 289 | 291 |
| 290 self.assertDictEqual(findit_object.GetPublishableResult(crash_identifiers, | 292 self.assertDictEqual(findit_object.GetPublishableResult(crash_identifiers, |
| 291 analysis), | 293 analysis), |
| 292 expected_processed_suspect) | 294 expected_processed_suspect) |
| OLD | NEW |