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

Unified Diff: tools/telemetry/telemetry/core/platform/profiler/android_systrace_profiler_unittest.py

Issue 328553007: telemetry: Don't over-communicate in Android Systrace profiler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « tools/telemetry/telemetry/core/platform/profiler/android_systrace_profiler.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/profiler/android_systrace_profiler_unittest.py
diff --git a/tools/telemetry/telemetry/core/platform/profiler/android_systrace_profiler_unittest.py b/tools/telemetry/telemetry/core/platform/profiler/android_systrace_profiler_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..6b84a219be9170667bc78f409847508704749668
--- /dev/null
+++ b/tools/telemetry/telemetry/core/platform/profiler/android_systrace_profiler_unittest.py
@@ -0,0 +1,30 @@
+# Copyright 2014 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 os
+import shutil
+import tempfile
+import zipfile
+
+from telemetry import test
+from telemetry.core.platform.profiler import android_systrace_profiler
+from telemetry.unittest import tab_test_case
+
+
+class TestAndroidSystraceProfiler(tab_test_case.TabTestCase):
+ @test.Enabled('android')
+ def testSystraceProfiler(self):
+ try:
+ out_dir = tempfile.mkdtemp()
+ # pylint: disable=W0212
+ profiler = android_systrace_profiler.AndroidSystraceProfiler(
+ self._browser._browser_backend,
+ self._browser._platform_backend,
+ os.path.join(out_dir, 'systrace'),
+ {})
+ result = profiler.CollectProfile()[0]
+ assert zipfile.is_zipfile(result)
+ with zipfile.ZipFile(result) as z:
+ self.assertEquals(len(z.namelist()), 2)
+ finally:
+ shutil.rmtree(out_dir)
« no previous file with comments | « tools/telemetry/telemetry/core/platform/profiler/android_systrace_profiler.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698