| 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)
|
|
|