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
3 # found in the LICENSE file.
7 from telemetry.core.platform.power_monitor import cros_sysfs_platform
10 class CrosSysfsPlatformTest(unittest.TestCase):
12 'cpu0': 'POLL\nC1\nC2\nC3\n0\n138356189\n102416540\n'
13 '17158209182\n0\n1\n500\n1000\n1403211341',
14 'cpu1': 'POLL\nC1\nC2\nC3\n0\n107318149\n81786238\n'
15 '17348563431\n0\n1\n500\n1000\n1403211341'
19 'C0': 1403193942018089,
25 'C0': 1403193803332182,
31 def testCrosParseCpuStates(self):
32 # Use mock start and end times to allow for the test to calculate C0.
33 results = cros_sysfs_platform.CrosSysfsPlatform.ParseStateSample(
36 for state in results[cpu]:
37 self.assertAlmostEqual(results[cpu][state],
38 self.expected_cstate[cpu][state])