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

Unified Diff: systrace/profile_chrome/profiler_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/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)

Powered by Google App Engine
This is Rietveld 408576698