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

Unified Diff: build/android/pylib/perf_tests_helper.py

Issue 11876021: Support startup performance tests on Galaxy S3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Support startup performance tests on Galaxy S3 - code review fixes Created 7 years, 11 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: build/android/pylib/perf_tests_helper.py
diff --git a/build/android/pylib/perf_tests_helper.py b/build/android/pylib/perf_tests_helper.py
index ee2519bbd3a2b523a57700d26019184c5c478449..68e4c943aae74e125b29b8fe1b683503a882edd7 100644
--- a/build/android/pylib/perf_tests_helper.py
+++ b/build/android/pylib/perf_tests_helper.py
@@ -142,10 +142,8 @@ class PerfTestSetup(object):
def DropRamCaches(self):
"""Drops the filesystem ram caches for performance testing."""
- if not self._adb.IsRootEnabled():
- self._adb.EnableAdbRoot()
- self._adb.RunShellCommand('sync')
- self._adb.RunShellCommand('echo 3 > ' + PerfTestSetup._DROP_CACHES)
+ self._adb.RunShellCommand('su -c sync')
+ self._adb.SetProtectedFileContents(PerfTestSetup._DROP_CACHES, '3')
def SetUp(self):
"""Sets up performance tests."""
@@ -165,6 +163,5 @@ class PerfTestSetup(object):
def _SetScalingGovernorInternal(self, value):
for cpu in range(self._kernel_max + 1):
scaling_governor_file = PerfTestSetup._SCALING_GOVERNOR_FMT % cpu
- if self._adb.Adb().DoesFileExist(scaling_governor_file):
- self._adb.RunShellCommand(
- ('echo %s > ' + scaling_governor_file) % value)
+ if self._adb.FileExistsOnDevice(scaling_governor_file):
+ self._adb.SetProtectedFileContents(scaling_governor_file, value)

Powered by Google App Engine
This is Rietveld 408576698