| 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 datetime import datetime | 5 from datetime import datetime |
| 6 | 6 |
| 7 from crash.test.crash_testcase import CrashTestCase | 7 from crash.test.crash_testcase import CrashTestCase |
| 8 from model import analysis_status | 8 from model import analysis_status |
| 9 from model import result_status | 9 from model import result_status |
| 10 from model.crash.fracas_crash_analysis import FracasCrashAnalysis | 10 from model.crash.fracas_crash_analysis import FracasCrashAnalysis |
| 11 | 11 |
| 12 | 12 |
| 13 class FracasCrashAnalysisTest(CrashTestCase): | 13 class FracasCrashAnalysisTest(CrashTestCase): |
| 14 | 14 |
| 15 def testDoNotUseIdentifiersToSetProperties(self): | 15 def testDoNotUseIdentifiersToSetProperties(self): |
| 16 crash_identifiers = { | 16 crash_identifiers = { |
| 17 'chrome_version': '1', | 17 'chrome_version': '1', |
| 18 'signature': 'signature/here', | 18 'signature': 'signature/here', |
| 19 'channel': 'canary', | 19 'channel': 'canary', |
| 20 'platform': 'win', | 20 'platform': 'win', |
| 21 'process_type': 'browser', | 21 'process_type': 'browser', |
| 22 } | 22 } |
| 23 FracasCrashAnalysis.Create(crash_identifiers).put() | 23 FracasCrashAnalysis.Create(crash_identifiers).put() |
| 24 analysis = FracasCrashAnalysis.Get(crash_identifiers) | 24 analysis = FracasCrashAnalysis.Get(crash_identifiers) |
| 25 self.assertIsNone(analysis.crashed_version) | 25 self.assertIsNone(analysis.crashed_version) |
| 26 self.assertIsNone(analysis.signature) | 26 self.assertIsNone(analysis.signature) |
| 27 self.assertIsNone(analysis.channel) | 27 self.assertIsNone(analysis.channel) |
| 28 self.assertIsNone(analysis.platform) | 28 self.assertIsNone(analysis.platform) |
| 29 | |
| 30 def testFracasCrashAnalysisReset(self): | |
| 31 analysis = FracasCrashAnalysis() | |
| 32 analysis.historical_metadata = {} | |
| 33 analysis.Reset() | |
| 34 self.assertIsNone(analysis.channel) | |
| 35 self.assertIsNone(analysis.historical_metadata) | |
| OLD | NEW |