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

Unified Diff: build/android/pylib/perf/perf_control_unittest.py

Issue 338233003: Telemetry: Set scaling governor on all cpus (on all devices) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback. 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
Index: build/android/pylib/perf/perf_control_unittest.py
diff --git a/build/android/pylib/perf/perf_control_unittest.py b/build/android/pylib/perf/perf_control_unittest.py
index a83b482f6f847c9531ff44c1880e94e45d0a044e..4fb36f72de64a24fae56deb6dd4f3ff48a363da3 100644
--- a/build/android/pylib/perf/perf_control_unittest.py
+++ b/build/android/pylib/perf/perf_control_unittest.py
@@ -12,7 +12,6 @@ from pylib import android_commands
from pylib.device import device_utils
from pylib.perf import perf_control
-
class TestPerfControl(unittest.TestCase):
def setUp(self):
if not os.getenv('BUILDTYPE'):
@@ -23,24 +22,19 @@ class TestPerfControl(unittest.TestCase):
self._device = device_utils.DeviceUtils(
android_commands.AndroidCommands(device=devices[0]))
- def testForceAllCpusOnline(self):
+ def testHighPerfMode(self):
perf = perf_control.PerfControl(self._device)
- cpu_online_files = self._device.RunShellCommand(
- 'ls -d /sys/devices/system/cpu/cpu[0-9]*/online')
try:
- perf.ForceAllCpusOnline(True)
- for path in cpu_online_files:
+ perf.ForceHighPerfMode()
pasko 2014/06/19 17:48:32 It was like that before, but this does not really
Sami 2014/06/19 18:12:43 Cue age old debate about integration vs. unit test
+ for cpu in range(perf.NumCpuCores()):
+ path = perf.CpuOnlineFormat() % cpu
self.assertEquals('1',
self._device.old_interface.GetFileContents(path)[0])
- mode = self._device.RunShellCommand('ls -l %s' % path)[0]
- self.assertEquals('-r--r--r--', mode[:10])
+ path = perf.ScalingGovernorFormat() % cpu
+ self.assertEquals('performance',
+ self._device.old_interface.GetFileContents(path)[0])
finally:
- perf.ForceAllCpusOnline(False)
-
- for path in cpu_online_files:
- mode = self._device.RunShellCommand('ls -l %s' % path)[0]
- self.assertEquals('-rw-r--r--', mode[:10])
-
+ perf.SetDefaultPerfMode()
if __name__ == '__main__':
unittest.main()

Powered by Google App Engine
This is Rietveld 408576698