Index: systrace/profile_chrome/profiler_unittest.py |
diff --git a/systrace/profile_chrome/profiler_unittest.py b/systrace/profile_chrome/profiler_unittest.py |
index 9b35753d3a1ab0867e9de071723553278110ba6d..df4a65707750a5ce6f6d79fe6e609c4caa29e4d5 100644 |
--- a/systrace/profile_chrome/profiler_unittest.py |
+++ b/systrace/profile_chrome/profiler_unittest.py |
@@ -2,9 +2,9 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+import json |
import os |
import unittest |
-import zipfile |
from profile_chrome import profiler |
from profile_chrome import ui |
@@ -37,9 +37,10 @@ class ProfilerTest(unittest.TestCase): |
[fake_agent_2], write_json=True) |
try: |
- self.assertFalse(result.endswith('.html')) |
+ self.assertTrue(result.endswith('.json')) |
with open(result) as f: |
- self.assertEquals(f.read(), 'fake-contents') |
+ trace_data = json.load(f) |
+ self.assertListEqual(trace_data['cpuSnapshots'], ['fake-contents']) |
finally: |
if os.path.exists(result): |
os.remove(result) |
@@ -51,8 +52,9 @@ class ProfilerTest(unittest.TestCase): |
write_json=True) |
try: |
- self.assertTrue(result.endswith('.zip')) |
- self.assertTrue(zipfile.is_zipfile(result)) |
+ self.assertTrue(result.endswith('.json')) |
+ with open(result, 'r') as fp: |
+ json.load(fp) |
finally: |
if os.path.exists(result): |
os.remove(result) |