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

Side by Side Diff: build/android/pylib/perf/perf_control_unittest.py

Issue 358993003: [Android] Switch to DeviceUtils versions of file functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 unified diff | Download patch
« no previous file with comments | « build/android/pylib/perf/perf_control.py ('k') | build/android/pylib/perf/thermal_throttle.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 # pylint: disable=W0212 4 # pylint: disable=W0212
5 5
6 import os 6 import os
7 import sys 7 import sys
8 import unittest 8 import unittest
9 9
10 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) 10 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
(...skipping 12 matching lines...) Expand all
23 self._device = device_utils.DeviceUtils( 23 self._device = device_utils.DeviceUtils(
24 android_commands.AndroidCommands(device=devices[0])) 24 android_commands.AndroidCommands(device=devices[0]))
25 25
26 def testHighPerfMode(self): 26 def testHighPerfMode(self):
27 perf = perf_control.PerfControl(self._device) 27 perf = perf_control.PerfControl(self._device)
28 try: 28 try:
29 perf.SetPerfProfilingMode() 29 perf.SetPerfProfilingMode()
30 for cpu in range(perf._num_cpu_cores): 30 for cpu in range(perf._num_cpu_cores):
31 path = perf_control.PerfControl._CPU_ONLINE_FMT % cpu 31 path = perf_control.PerfControl._CPU_ONLINE_FMT % cpu
32 self.assertEquals('1', 32 self.assertEquals('1',
33 self._device.old_interface.GetFileContents(path)[0]) 33 self._device.ReadFile(path)[0])
34 path = perf_control.PerfControl._SCALING_GOVERNOR_FMT % cpu 34 path = perf_control.PerfControl._SCALING_GOVERNOR_FMT % cpu
35 self.assertEquals('performance', 35 self.assertEquals('performance',
36 self._device.old_interface.GetFileContents(path)[0]) 36 self._device.ReadFile(path)[0])
37 finally: 37 finally:
38 perf.SetDefaultPerfMode() 38 perf.SetDefaultPerfMode()
39 39
40 if __name__ == '__main__': 40 if __name__ == '__main__':
41 unittest.main() 41 unittest.main()
OLDNEW
« no previous file with comments | « build/android/pylib/perf/perf_control.py ('k') | build/android/pylib/perf/thermal_throttle.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698