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

Unified Diff: telemetry/telemetry/internal/platform/profiler/trace_profiler_unittest.py

Issue 2661573003: Refactor TraceData to encapsulate internal traces' representation (Closed)
Patch Set: Address Charlie's comments 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: telemetry/telemetry/internal/platform/profiler/trace_profiler_unittest.py
diff --git a/telemetry/telemetry/internal/platform/profiler/trace_profiler_unittest.py b/telemetry/telemetry/internal/platform/profiler/trace_profiler_unittest.py
index efacad7c0bc930caffe6b9b0f4d1d0f3e69d02ba..3e5f542db12650ebc7ff5a5157cae0329d1d27ff 100644
--- a/telemetry/telemetry/internal/platform/profiler/trace_profiler_unittest.py
+++ b/telemetry/telemetry/internal/platform/profiler/trace_profiler_unittest.py
@@ -1,11 +1,9 @@
# Copyright 2015 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 json
import os
import shutil
import tempfile
-import zipfile
from telemetry.internal.platform.profiler import trace_profiler
from telemetry.testing import tab_test_case
@@ -22,10 +20,7 @@ class TestTraceProfiler(tab_test_case.TabTestCase):
os.path.join(out_dir, 'trace'),
{})
result = profiler.CollectProfile()[0]
- self.assertTrue(zipfile.is_zipfile(result))
- with zipfile.ZipFile(result) as z:
- self.assertEquals(len(z.namelist()), 1)
- with z.open(z.namelist()[0]) as f:
- json.load(f)
+ with open(result) as f:
+ self.assertTrue(f.read())
finally:
shutil.rmtree(out_dir)

Powered by Google App Engine
This is Rietveld 408576698