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

Side by Side Diff: tracing/bin/symbolize_trace_atos_regex_unittest.py

Issue 2605183002: Update symbolize_trace to work on macOS. (Closed)
Patch Set: Comments from dskiba. Created 3 years, 10 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 | « tracing/bin/symbolize_trace_atos_regex.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
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2017 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import os
7 import sys
8 import unittest
9
10 sys.path.insert(0, os.path.dirname(__file__))
11 import symbolize_trace_atos_regex
12
13
14 class AtosRegexTest(unittest.TestCase):
15 def testRegex(self):
16 if sys.platform != "darwin":
17 return
18 matcher = symbolize_trace_atos_regex.AtosRegexMatcher()
19 text = "-[SKTGraphicView drawRect:] (in Sketch) (SKTGraphicView.m:445)"
20 output = matcher.Match(text)
21 self.assertEqual("-[SKTGraphicView drawRect:]", output)
22
23 text = "malloc (in libsystem_malloc.dylib) + 42"
24 output = matcher.Match(text)
25 self.assertEqual("malloc", output)
26
27 expected_output = (
28 "content::CacheStorage::MatchAllCaches(std::__1::unique_ptr<content::Se"
29 "rviceWorkerFetchRequest, std::__1::default_delete<content::ServiceWork"
30 "erFetchRequest> >, content::CacheStorageCacheQueryParams const&, base:"
31 ":Callback<void (content::CacheStorageError, std::__1::unique_ptr<conte"
32 "nt::ServiceWorkerResponse, std::__1::default_delete<content::ServiceWo"
33 "rkerResponse> >, std::__1::unique_ptr<storage::BlobDataHandle, std::__"
34 "1::default_delete<storage::BlobDataHandle> >), (base::internal::CopyMo"
35 "de)1, (base::internal::RepeatMode)1> const&)"
36 )
37 text = expected_output + " (in Chromium Framework) (ref_counted.h:322)"
38 output = matcher.Match(text)
39 self.assertEqual(expected_output, output)
40
41 text = "0x4a12"
42 output = matcher.Match(text)
43 self.assertEqual(text, output)
44
45 text = "0x00000d9a (in Chromium)"
46 output = matcher.Match(text)
47 self.assertEqual(text, output)
48
49
50 if __name__ == '__main__':
51 unittest.main()
OLDNEW
« no previous file with comments | « tracing/bin/symbolize_trace_atos_regex.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698