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

Unified Diff: tools/telemetry/telemetry/core/platform/power_monitor/cros_sysfs_platform_unittest.py

Issue 425133002: [Telemetry] Fix power monitor negative c-state residency percentages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed failing test case. Created 6 years, 4 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: tools/telemetry/telemetry/core/platform/power_monitor/cros_sysfs_platform_unittest.py
diff --git a/tools/telemetry/telemetry/core/platform/power_monitor/cros_sysfs_platform_unittest.py b/tools/telemetry/telemetry/core/platform/power_monitor/cros_sysfs_platform_unittest.py
index 4504848a01a076d97eddbebc15ef6b8510ec04c9..a773a6ffcd0365b6c939c4dbe89791c0eba9d949 100644
--- a/tools/telemetry/telemetry/core/platform/power_monitor/cros_sysfs_platform_unittest.py
+++ b/tools/telemetry/telemetry/core/platform/power_monitor/cros_sysfs_platform_unittest.py
@@ -8,12 +8,11 @@ from telemetry.core.platform.power_monitor import cros_sysfs_platform
class CrosSysfsPlatformTest(unittest.TestCase):
- start_time = 1403211341
initial_cstate = {
'cpu0': 'POLL\nC1\nC2\nC3\n0\n138356189\n102416540\n'
- '17158209182\n0\n1\n500\n1000',
+ '17158209182\n0\n1\n500\n1000\n1403211341',
'cpu1': 'POLL\nC1\nC2\nC3\n0\n107318149\n81786238\n'
- '17348563431\n0\n1\n500\n1000'
+ '17348563431\n0\n1\n500\n1000\n1403211341'
}
expected_cstate = {
'cpu0': {
@@ -32,7 +31,7 @@ class CrosSysfsPlatformTest(unittest.TestCase):
def testCrosParseCpuStates(self):
# Use mock start and end times to allow for the test to calculate C0.
results = cros_sysfs_platform.CrosSysfsPlatform.ParseStateSample(
- self.initial_cstate, self.start_time)
+ self.initial_cstate)
for cpu in results:
for state in results[cpu]:
self.assertAlmostEqual(results[cpu][state],

Powered by Google App Engine
This is Rietveld 408576698