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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/bin/symbolize_trace_atos_regex.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/bin/symbolize_trace_atos_regex_unittest.py
diff --git a/tracing/bin/symbolize_trace_atos_regex_unittest.py b/tracing/bin/symbolize_trace_atos_regex_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..b773dc94aa22187e4281feac24a0ecc462b84f20
--- /dev/null
+++ b/tracing/bin/symbolize_trace_atos_regex_unittest.py
@@ -0,0 +1,51 @@
+#!/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 os
+import sys
+import unittest
+
+sys.path.insert(0, os.path.dirname(__file__))
+import symbolize_trace_atos_regex
+
+
+class AtosRegexTest(unittest.TestCase):
+ def testRegex(self):
+ if sys.platform != "darwin":
+ return
+ matcher = symbolize_trace_atos_regex.AtosRegexMatcher()
+ text = "-[SKTGraphicView drawRect:] (in Sketch) (SKTGraphicView.m:445)"
+ output = matcher.Match(text)
+ self.assertEqual("-[SKTGraphicView drawRect:]", output)
+
+ text = "malloc (in libsystem_malloc.dylib) + 42"
+ output = matcher.Match(text)
+ self.assertEqual("malloc", output)
+
+ expected_output = (
+ "content::CacheStorage::MatchAllCaches(std::__1::unique_ptr<content::Se"
+ "rviceWorkerFetchRequest, std::__1::default_delete<content::ServiceWork"
+ "erFetchRequest> >, content::CacheStorageCacheQueryParams const&, base:"
+ ":Callback<void (content::CacheStorageError, std::__1::unique_ptr<conte"
+ "nt::ServiceWorkerResponse, std::__1::default_delete<content::ServiceWo"
+ "rkerResponse> >, std::__1::unique_ptr<storage::BlobDataHandle, std::__"
+ "1::default_delete<storage::BlobDataHandle> >), (base::internal::CopyMo"
+ "de)1, (base::internal::RepeatMode)1> const&)"
+ )
+ text = expected_output + " (in Chromium Framework) (ref_counted.h:322)"
+ output = matcher.Match(text)
+ self.assertEqual(expected_output, output)
+
+ text = "0x4a12"
+ output = matcher.Match(text)
+ self.assertEqual(text, output)
+
+ text = "0x00000d9a (in Chromium)"
+ output = matcher.Match(text)
+ self.assertEqual(text, output)
+
+
+if __name__ == '__main__':
+ unittest.main()
« 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