| 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 collections import defaultdict | 5 from collections import defaultdict |
| 6 | 6 |
| 7 from common.blame import Region, Blame | 7 from common.blame import Region, Blame |
| 8 from common.change_log import ChangeLog | 8 from common.change_log import ChangeLog |
| 9 from common.dependency import Dependency, DependencyRoll | 9 from common.dependency import Dependency, DependencyRoll |
| 10 from common.git_repository import GitRepository | 10 from common.git_repository import GitRepository |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 match_result2.min_distance = 20 | 291 match_result2.min_distance = 20 |
| 292 | 292 |
| 293 return [match_result1, match_result2], {} | 293 return [match_result1, match_result2], {} |
| 294 | 294 |
| 295 self.mock(findit_for_crash, 'FindMatchResults', _MockFindMatchResults) | 295 self.mock(findit_for_crash, 'FindMatchResults', _MockFindMatchResults) |
| 296 | 296 |
| 297 expected_match_results = [ | 297 expected_match_results = [ |
| 298 { | 298 { |
| 299 'reason': ('(1) Modified top crashing frame is #0\n' | 299 'reason': ('(1) Modified top crashing frame is #0\n' |
| 300 '(2) Modification distance (LOC) is 0\n\n' | 300 '(2) Modification distance (LOC) is 0\n\n' |
| 301 'Changed file a.cc crashed in func (#0), func (#1)'), | 301 'Changed file a.cc crashed in frame #0, frame #1'), |
| 302 'time': 'Thu Mar 31 21:24:43 2016', | 302 'time': 'Thu Mar 31 21:24:43 2016', |
| 303 'author': 'r@chromium.org', | 303 'author': 'r@chromium.org', |
| 304 'url': 'https://repo.test/+/1', | 304 'url': 'https://repo.test/+/1', |
| 305 'project_path': 'src/', | 305 'project_path': 'src/', |
| 306 'review_url': 'https://codereview.chromium.org/3281', | 306 'review_url': 'https://codereview.chromium.org/3281', |
| 307 'confidence': 1.0, 'revision': '1' | 307 'confidence': 1.0, 'revision': '1' |
| 308 }, | 308 }, |
| 309 ] | 309 ] |
| 310 | 310 |
| 311 regression_deps_rolls = {'src/': DependencyRoll('src/', 'https://repo', | 311 regression_deps_rolls = {'src/': DependencyRoll('src/', 'https://repo', |
| (...skipping 30 matching lines...) Expand all Loading... |
| 342 match_result3.min_distance = 60 | 342 match_result3.min_distance = 60 |
| 343 | 343 |
| 344 return [match_result1, match_result2, match_result3], {} | 344 return [match_result1, match_result2, match_result3], {} |
| 345 | 345 |
| 346 self.mock(findit_for_crash, 'FindMatchResults', _MockFindMatchResults) | 346 self.mock(findit_for_crash, 'FindMatchResults', _MockFindMatchResults) |
| 347 | 347 |
| 348 expected_match_results = [ | 348 expected_match_results = [ |
| 349 { | 349 { |
| 350 'reason': ('(1) Modified top crashing frame is #0\n' | 350 'reason': ('(1) Modified top crashing frame is #0\n' |
| 351 '(2) Modification distance (LOC) is 1\n\n' | 351 '(2) Modification distance (LOC) is 1\n\n' |
| 352 'Changed file a.cc crashed in func (#0), func (#1)'), | 352 'Changed file a.cc crashed in frame #0, frame #1'), |
| 353 'time': 'Thu Mar 31 21:24:43 2016', | 353 'time': 'Thu Mar 31 21:24:43 2016', |
| 354 'author': 'r@chromium.org', | 354 'author': 'r@chromium.org', |
| 355 'url': 'https://repo.test/+/1', | 355 'url': 'https://repo.test/+/1', |
| 356 'project_path': 'src/', | 356 'project_path': 'src/', |
| 357 'review_url': 'https://codereview.chromium.org/3281', | 357 'review_url': 'https://codereview.chromium.org/3281', |
| 358 'confidence': 0.8, 'revision': '1'}, | 358 'confidence': 0.8, 'revision': '1'}, |
| 359 ] | 359 ] |
| 360 | 360 |
| 361 regression_deps_rolls = {'src/': DependencyRoll('src/', 'https://repo', | 361 regression_deps_rolls = {'src/': DependencyRoll('src/', 'https://repo', |
| 362 '1', '2')} | 362 '1', '2')} |
| (...skipping 22 matching lines...) Expand all Loading... |
| 385 | 385 |
| 386 return [match_result1, match_result2], {} | 386 return [match_result1, match_result2], {} |
| 387 | 387 |
| 388 self.mock(findit_for_crash, 'FindMatchResults', _MockFindMatchResults) | 388 self.mock(findit_for_crash, 'FindMatchResults', _MockFindMatchResults) |
| 389 | 389 |
| 390 regression_deps_rolls = {'src/': DependencyRoll('src/', 'https://repo', | 390 regression_deps_rolls = {'src/': DependencyRoll('src/', 'https://repo', |
| 391 '1', '2')} | 391 '1', '2')} |
| 392 | 392 |
| 393 self.assertEqual(findit_for_crash.FindItForCrash( | 393 self.assertEqual(findit_for_crash.FindItForCrash( |
| 394 Stacktrace(), regression_deps_rolls, {}), []) | 394 Stacktrace(), regression_deps_rolls, {}), []) |
| OLD | NEW |