| 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 copy | 5 import copy |
| 6 | 6 |
| 7 from google.appengine.api import users | 7 from google.appengine.api import users |
| 8 | 8 |
| 9 from common.change_log import ChangeLog |
| 9 from common.findit_testcase import FinditTestCase | 10 from common.findit_testcase import FinditTestCase |
| 10 from model.crash.crash_config import CrashConfig | 11 from model.crash.crash_config import CrashConfig |
| 11 | 12 |
| 12 | 13 |
| 13 DEFAULT_CONFIG_DATA = { | 14 DEFAULT_CONFIG_DATA = { |
| 14 'fracas': { | 15 'fracas': { |
| 15 'analysis_result_pubsub_topic': 'projects/project-name/topics/name', | 16 'analysis_result_pubsub_topic': 'projects/project-name/topics/name', |
| 16 'supported_platform_list_by_channel': { | 17 'supported_platform_list_by_channel': { |
| 17 'canary': ['win', 'mac'], | 18 'canary': ['win', 'mac'], |
| 18 'supported_channel': ['supported_platform'], | 19 'supported_channel': ['supported_platform'], |
| 19 }, | 20 }, |
| 21 }, |
| 22 'component_classifier': { |
| 23 "path_function_component": [ |
| 24 [ |
| 25 "src/comp1.*", |
| 26 "", |
| 27 "Comp1>Dummy" |
| 28 ], |
| 29 [ |
| 30 "src/comp2.*", |
| 31 "func2.*", |
| 32 "Comp2>Dummy" |
| 33 ], |
| 34 ], |
| 35 "top_n": "4" |
| 36 }, |
| 37 'project_classifier': { |
| 38 "file_path_marker_to_project_name": { |
| 39 "googleplex-android/": "android_os", |
| 40 }, |
| 41 "function_marker_to_project_name": { |
| 42 "android.": "android_os", |
| 43 }, |
| 44 "host_directories": [ |
| 45 "src/" |
| 46 ], |
| 47 "non_chromium_project_rank_priority": { |
| 48 "android_os": "-1", |
| 49 }, |
| 50 "top_n": "4" |
| 20 } | 51 } |
| 21 } | 52 } |
| 22 | 53 |
| 54 DUMMY_CHANGELOG = ChangeLog.FromDict({ |
| 55 'author_name': 'r@chromium.org', |
| 56 'message': 'dummy', |
| 57 'committer_email': 'r@chromium.org', |
| 58 'commit_position': 175900, |
| 59 'author_email': 'r@chromium.org', |
| 60 'touched_files': [ |
| 61 { |
| 62 'change_type': 'add', |
| 63 'new_path': 'a.cc', |
| 64 'old_path': None, |
| 65 }, |
| 66 ], |
| 67 'author_time': 'Thu Mar 31 21:24:43 2016', |
| 68 'committer_time': 'Thu Mar 31 21:28:39 2016', |
| 69 'commit_url': |
| 70 'https://repo.test/+/1', |
| 71 'code_review_url': 'https://codereview.chromium.org/3281', |
| 72 'committer_name': 'example@chromium.org', |
| 73 'revision': '1', |
| 74 'reverted_revision': None |
| 75 }) |
| 76 |
| 77 |
| 23 class CrashTestCase(FinditTestCase): # pragma: no cover. | 78 class CrashTestCase(FinditTestCase): # pragma: no cover. |
| 24 | 79 |
| 25 def setUp(self): | 80 def setUp(self): |
| 26 super(CrashTestCase, self).setUp() | 81 super(CrashTestCase, self).setUp() |
| 27 CrashConfig.Get().Update( | 82 CrashConfig.Get().Update( |
| 28 users.User(email='admin@chromium.org'), True, **DEFAULT_CONFIG_DATA) | 83 users.User(email='admin@chromium.org'), True, **DEFAULT_CONFIG_DATA) |
| 29 | 84 |
| 30 | 85 def GetDummyChangeLog(self): |
| 86 return DUMMY_CHANGELOG |
| OLD | NEW |