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.
9 from telemetry
import decorators
10 from telemetry
.internal
.platform
.power_monitor
import msr_power_monitor
11 from telemetry
.internal
.platform
import win_platform_backend
14 class MsrPowerMonitorTest(unittest
.TestCase
):
15 @decorators.Enabled('xp', 'win7', 'win8') # http://crbug.com/479337
16 def testMsrRuns(self
):
17 platform_backend
= win_platform_backend
.WinPlatformBackend()
18 power_monitor
= msr_power_monitor
.MsrPowerMonitorWin(platform_backend
)
19 if not power_monitor
.CanMonitorPower():
20 logging
.warning('Test not supported on this platform.')
23 power_monitor
.StartMonitoringPower(None)
25 statistics
= power_monitor
.StopMonitoringPower()
27 self
.assertEqual(statistics
['identifier'], 'msr')
28 self
.assertIn('energy_consumption_mwh', statistics
)
29 self
.assertGreater(statistics
['energy_consumption_mwh'], 0)