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

Unified Diff: systrace/systrace/tracing_agents/atrace_from_file_agent_unittest.py

Issue 2712163002: [Systrace] Fix systrace clock syncing issue with BattOr. (Closed)
Patch Set: 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
Index: systrace/systrace/tracing_agents/atrace_from_file_agent_unittest.py
diff --git a/systrace/systrace/tracing_agents/atrace_from_file_agent_unittest.py b/systrace/systrace/tracing_agents/atrace_from_file_agent_unittest.py
index 3efa099103cf40e5c4f10cae9bca5e06be756dc1..7c99f42dbdcdb7617ca70ddff0e2d54ec3e90e59 100755
--- a/systrace/systrace/tracing_agents/atrace_from_file_agent_unittest.py
+++ b/systrace/systrace/tracing_agents/atrace_from_file_agent_unittest.py
@@ -5,6 +5,7 @@
# found in the LICENSE file.
import contextlib
+import json
import os
import unittest
@@ -30,15 +31,15 @@ class AtraceFromFileAgentTest(unittest.TestCase):
'--from-file',
COMPRESSED_ATRACE_DATA,
'-o',
- output_file_name])
+ output_file_name,
+ '--json'])
# and verify file contents
- with contextlib.nested(open(output_file_name, 'r'),
+ with contextlib.nested(open(output_file_name+'.json', 'r'),
open(DECOMPRESSED_ATRACE_DATA, 'r')) as (f1, f2):
- full_trace = f1.read()
+ full_trace = json.load(f1)#f1.read()
expected_contents = f2.read()
- self.assertTrue(expected_contents in full_trace)
- except:
- raise
+ atrace = full_trace['systemTraceEvents'][0]
+ self.assertTrue(expected_contents in atrace.decode('string_escape'))
finally:
if os.path.exists(output_file_name):
os.remove(output_file_name)

Powered by Google App Engine
This is Rietveld 408576698