| 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 from common import chrome_dependency_fetcher | 5 from common import chrome_dependency_fetcher |
| 6 from common.dependency import DependencyRoll | 6 from common.dependency import DependencyRoll |
| 7 from common.http_client_appengine import HttpClientAppengine | 7 from common.http_client_appengine import HttpClientAppengine |
| 8 from crash import chromecrash_parser | 8 from crash import chromecrash_parser |
| 9 from crash import detect_regression_range | 9 from crash import detect_regression_range |
| 10 from crash import findit_for_chromecrash | 10 from crash import findit_for_chromecrash |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 analysis.stack_trace = 'frame1\nframe2' | 255 analysis.stack_trace = 'frame1\nframe2' |
| 256 analysis.crashed_version = '50.0.1234.0' | 256 analysis.crashed_version = '50.0.1234.0' |
| 257 dummy_regression_range = ['50.0.1233.0', '50.0.1234.0'] | 257 dummy_regression_range = ['50.0.1233.0', '50.0.1234.0'] |
| 258 analysis.regression_range = dummy_regression_range | 258 analysis.regression_range = dummy_regression_range |
| 259 culprit = _FinditForChromeCrash().FindCulprit(analysis) | 259 culprit = _FinditForChromeCrash().FindCulprit(analysis) |
| 260 self.assertIsNotNone(culprit, 'FindCulprit failed unexpectedly') | 260 self.assertIsNotNone(culprit, 'FindCulprit failed unexpectedly') |
| 261 results, tag = culprit.ToDicts() | 261 results, tag = culprit.ToDicts() |
| 262 | 262 |
| 263 expected_results = { | 263 expected_results = { |
| 264 'found': True, | 264 'found': True, |
| 265 'suspected_project': '', | |
| 266 'suspected_components': [], | |
| 267 'suspected_cls': [dummy_match_result.ToDict()], | 265 'suspected_cls': [dummy_match_result.ToDict()], |
| 268 'regression_range': dummy_regression_range | 266 'regression_range': dummy_regression_range |
| 269 } | 267 } |
| 270 expected_tag = { | 268 expected_tag = { |
| 271 'found_suspects': True, | 269 'found_suspects': True, |
| 272 'found_project': False, | 270 'found_project': False, |
| 273 'found_components': False, | 271 'found_components': False, |
| 274 'has_regression_range': True, | 272 'has_regression_range': True, |
| 275 'solution': 'core_algorithm', | 273 'solution': 'core_algorithm', |
| 276 } | 274 } |
| 277 | 275 |
| 278 self.assertDictEqual(expected_results, results) | 276 self.assertDictEqual(expected_results, results) |
| 279 self.assertDictEqual(expected_tag, tag) | 277 self.assertDictEqual(expected_tag, tag) |
| 280 | 278 |
| 281 def _testFindCulpritForChromeCrashFails(self): | 279 def _testFindCulpritForChromeCrashFails(self): |
| 282 analysis = CrashAnalysis() | 280 analysis = CrashAnalysis() |
| 283 analysis.signature = 'signature' | 281 analysis.signature = 'signature' |
| 284 analysis.platform = 'win' | 282 analysis.platform = 'win' |
| 285 analysis.stack_trace = 'frame1\nframe2' | 283 analysis.stack_trace = 'frame1\nframe2' |
| 286 analysis.crashed_version = '50.0.1234.0' | 284 analysis.crashed_version = '50.0.1234.0' |
| 287 results, tag = _FinditForChromeCrash().FindCulprit(analysis).ToDicts() | 285 results, tag = _FinditForChromeCrash().FindCulprit(analysis).ToDicts() |
| 288 | 286 |
| 289 expected_results = { | 287 expected_results = {'found': False} |
| 290 'found': False, | |
| 291 'suspected_project': '', | |
| 292 'suspected_components': [], | |
| 293 'suspected_cls': [], | |
| 294 } | |
| 295 expected_tag = { | 288 expected_tag = { |
| 296 'found_suspects': False, | 289 'found_suspects': False, |
| 297 'found_project': False, | 290 'found_project': False, |
| 298 'found_components': False, | 291 'found_components': False, |
| 299 'has_regression_range': False, | 292 'has_regression_range': False, |
| 300 'solution': 'core_algorithm', | 293 'solution': 'core_algorithm', |
| 301 } | 294 } |
| 302 | 295 |
| 303 self.assertDictEqual(expected_results, results) | 296 self.assertDictEqual(expected_results, results) |
| 304 self.assertDictEqual(expected_tag, tag) | 297 self.assertDictEqual(expected_tag, tag) |
| OLD | NEW |