summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/catapult/tracing/tracing/extras/symbolizer/symbolize_trace_macho_reader_unittest.py
blob: f0058abda514757acf678335fa4c681a43ee9761 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import sys
import unittest

from . import symbolize_trace_macho_reader


class AtosRegexTest(unittest.TestCase):
  def testRegex(self):
    if sys.platform != "darwin":
      return
    file_name = "/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit"
    result = symbolize_trace_macho_reader.ReadMachOTextLoadAddress(file_name)
    self.assertNotEqual(None, result)

    file_name = "/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa"
    result = symbolize_trace_macho_reader.ReadMachOTextLoadAddress(file_name)
    self.assertNotEqual(None, result)


if __name__ == '__main__':
  unittest.main()