Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2049)

Side by Side Diff: appengine/findit/crash/test/stacktrace_test.py

Issue 1980203002: [Findit] Filter inline function path frames (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase and fix nits. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « appengine/findit/crash/test/fracas_parser_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 crash.callstack import CallStack 5 from crash.callstack import CallStack
6 from crash.callstack import StackFrame
6 from crash.stacktrace import Stacktrace 7 from crash.stacktrace import Stacktrace
7 from crash.test.crash_test_suite import CrashTestSuite 8 from crash.test.stacktrace_test_suite import StacktraceTestSuite
8 9
9 10
10 class StacktraceTest(CrashTestSuite): 11 class StacktraceTest(StacktraceTestSuite):
12 def testCrashStackForStacktraceWithoutSignature(self):
13 frame_list1 = [
14 StackFrame(0, 'src/', '', 'func', 'file0.cc', [32])]
11 15
12 def testGetCrashStack(self): 16 frame_list2 = [
13 stack_trace = Stacktrace() 17 StackFrame(0, 'src/', '', 'func2', 'file0.cc', [32])]
14 self.assertEqual(stack_trace.GetCrashStack(), None) 18
19 stacktrace = Stacktrace([CallStack(0, frame_list=frame_list1),
20 CallStack(1, frame_list=frame_list2)])
21 expected_crash_stack = CallStack(0, frame_list=frame_list1)
22
23 self._VerifyTwoCallStacksEqual(stacktrace.crash_stack, expected_crash_stack)
24
25 def testFilterFramesBeforeSignatureForCrashStack(self):
26 frame_list1 = [
27 StackFrame(0, 'src/', '', 'func', 'file0.cc', [32]),
28 ]
29 callstack1 = CallStack(0, frame_list=frame_list1)
30
31 frame_list2 = [
32 StackFrame(0, 'src/', '', 'func', 'file0.cc', [32]),
33 StackFrame(1, 'src/', '', 'signature_func', 'file1.cc', [53]),
34 StackFrame(2, 'src/', '', 'funcc', 'file2.cc', [3])
35 ]
36 callstack2 = CallStack(0, frame_list=frame_list2)
37
38 stacktrace = Stacktrace([callstack1, callstack2], 'signature')
39
40 expected_frame_list = [
41 StackFrame(1, 'src/', '', 'signature_func', 'file1.cc', [53]),
42 StackFrame(2, 'src/', '', 'funcc', 'file2.cc', [3])]
43 expected_crash_stack = CallStack(0, frame_list=expected_frame_list)
44
45 self._VerifyTwoCallStacksEqual(stacktrace.crash_stack,
46 expected_crash_stack)
47
48 def testNoSignatureMatchForCrashStack(self):
49 frame_list = [
50 StackFrame(0, 'src/', '', 'func', 'file0.cc', [32]),
51 ]
52 callstack = CallStack(0, frame_list=frame_list)
53
54 stacktrace = Stacktrace([callstack], 'signature')
55
56 expected_frame_list = frame_list
57 expected_crash_stack = CallStack(0, frame_list=expected_frame_list)
58
59 self._VerifyTwoCallStacksEqual(stacktrace.crash_stack,
60 expected_crash_stack)
61
62 def testCrashStackFallBackToFirstLeastPriorityCallStack(self):
63 stacktrace = Stacktrace()
64 self.assertEqual(stacktrace.crash_stack, None)
15 65
16 callstack_list = [CallStack(0), CallStack(1)] 66 callstack_list = [CallStack(0), CallStack(1)]
17 stack_trace.extend(callstack_list) 67 stacktrace.extend(callstack_list)
18 68
19 self._VerifyTwoCallStacksEqual(stack_trace.GetCrashStack(), 69 self._VerifyTwoCallStacksEqual(stacktrace.crash_stack,
20 callstack_list[0]) 70 callstack_list[0])
21 71
22 def testInitStacktaceByCopyAnother(self): 72 def testInitStacktaceByCopyAnother(self):
23 stack_trace = Stacktrace() 73 stack_trace = Stacktrace()
24 stack_trace.extend([CallStack(0), CallStack(1)]) 74 stack_trace.extend([CallStack(0), CallStack(1)])
25 75
26 self._VerifyTwoStacktracesEqual(Stacktrace(stack_trace), stack_trace) 76 self._VerifyTwoStacktracesEqual(Stacktrace(stack_trace), stack_trace)
OLDNEW
« no previous file with comments | « appengine/findit/crash/test/fracas_parser_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698