| 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..7bdc962a48f9cfae289f5f58579369b5ac66a3f8 100644
|
| --- a/build/android/pylib/perf/perf_control_unittest.py
|
| +++ b/build/android/pylib/perf/perf_control_unittest.py
|
| @@ -1,6 +1,7 @@
|
| # 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.
|
| +# pylint: disable=W0212
|
|
|
| import os
|
| import sys
|
| @@ -12,7 +13,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 +23,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.SetPerfProfilingMode()
|
| + for cpu in range(perf._NumCpuCores):
|
| + path = perf_control.PerfControl._CPU_ONLINE_FMT % 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_control.PerfControl._SCALING_GOVERNOR_FMT % 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()
|
|
|