Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / tools / memory_inspector / memory_inspector / core / stacktrace_unittest.py
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import unittest
6
7 from memory_inspector.core import stacktrace
8
9
10 class StacktraceTest(unittest.TestCase):
11   def runTest(self):
12     st = stacktrace.Stacktrace()
13     frame_1 = stacktrace.Frame(20)
14     frame_2 = stacktrace.Frame(24)
15     frame_2.SetExecFileInfo('/foo/bar.so', 0)
16     self.assertEqual(frame_2.exec_file_name, 'bar.so')
17     st.Add(frame_1)
18     st.Add(frame_1)
19     st.Add(frame_2)
20     st.Add(frame_1)
21     self.assertEqual(st.depth, 4)