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

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

Issue 1980203002: [Findit] Filter inline function path frames (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: 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
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 common.dependency import Dependency 5 from common.dependency import Dependency
6 from crash.callstack import StackFrame, CallStack 6 from crash.callstack import StackFrame, CallStack
7 from crash.test.stacktrace_test_suite import StacktraceTestSuite 7 from crash.test.stacktrace_test_suite import StacktraceTestSuite
8 from crash.type_enums import CallStackFormatType 8 from crash.type_enums import CallStackFormatType
9 9
10 10
11 class CallStackTest(StacktraceTestSuite): 11 class CallStackTest(StacktraceTestSuite):
12 12
13 def testStackFrameToString(self): 13 def testStackFrameToString(self):
14 self.assertEqual( 14 self.assertEqual(
15 StackFrame(0, 'src/', '', 'func', 'f.cc', []).ToString(), 15 StackFrame(0, 'src/', '', 'func', 'f.cc', []).ToString(),
16 '#0 in func @ f.cc') 16 '#0 in func @ f.cc')
17 self.assertEqual( 17 self.assertEqual(
18 StackFrame(0, 'src/', '', 'func', 'f.cc', [1]).ToString(), 18 StackFrame(0, 'src/', '', 'func', 'f.cc', [1]).ToString(),
19 '#0 in func @ f.cc:1') 19 '#0 in func @ f.cc:1')
20 self.assertEqual( 20 self.assertEqual(
21 StackFrame(0, 'src/', '', 'func', 'f.cc', [1, 2, 3, 4]).ToString(), 21 StackFrame(0, 'src/', '', 'func', 'f.cc', [1, 2, 3, 4]).ToString(),
22 '#0 in func @ f.cc:1:3') 22 '#0 in func @ f.cc:1:3')
23 23
24 def testFrameListInitCallStack(self):
25 stack = CallStack(0)
26 stack.extend([StackFrame(0, 'src/', '', 'func', 'f.cc', [2])])
27
28 copy_stack = CallStack(stack.priority, frame_list=stack)
29 self._VerifyTwoCallStacksEqual(copy_stack, stack)
30
24 def testParseLineForJavaCallstackFormat(self): 31 def testParseLineForJavaCallstackFormat(self):
25 stack = CallStack(0, CallStackFormatType.JAVA) 32 stack = CallStack(0, CallStackFormatType.JAVA)
26 33
27 stack.ParseLine('dummy line', {}) 34 stack.ParseLine('dummy line', {})
28 self.assertEqual(stack, []) 35 self.assertEqual(stack, [])
29 36
30 deps = {'org/': Dependency('org/', 'https://repo', '1')} 37 deps = {'org/': Dependency('org/', 'https://repo', '1')}
31 stack.ParseLine(' at org.a.b(a.java:609)', deps) 38 stack.ParseLine(' at org.a.b(a.java:609)', deps)
32 self._VerifyTwoStackFramesEqual( 39 self._VerifyTwoStackFramesEqual(
33 stack[0], 40 stack[0],
(...skipping 18 matching lines...) Expand all
52 self.assertEqual(stack, []) 59 self.assertEqual(stack, [])
53 60
54 stack.ParseLine('#dummy line', {}) 61 stack.ParseLine('#dummy line', {})
55 self.assertEqual(stack, []) 62 self.assertEqual(stack, [])
56 63
57 deps = {'tp/webrtc/': Dependency('tp/webrtc/', 'https://repo', '1')} 64 deps = {'tp/webrtc/': Dependency('tp/webrtc/', 'https://repo', '1')}
58 stack.ParseLine('#0 0x52617a in func0 tp/webrtc/a.c:38:3', deps) 65 stack.ParseLine('#0 0x52617a in func0 tp/webrtc/a.c:38:3', deps)
59 self._VerifyTwoStackFramesEqual( 66 self._VerifyTwoStackFramesEqual(
60 stack[0], 67 stack[0],
61 StackFrame(0, 'tp/webrtc/', '', 'func0', 'a.c', [38, 39, 40, 41])) 68 StackFrame(0, 'tp/webrtc/', '', 'func0', 'a.c', [38, 39, 40, 41]))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698