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.
8 from telemetry
import decorators
9 from telemetry
.core
.platform
import win_platform_backend
10 from telemetry
.core
.platform
.power_monitor
import ippet_power_monitor
13 class IppetPowerMonitorTest(unittest
.TestCase
):
15 def testFindOrInstallIppet(self
):
16 self
.assertTrue(ippet_power_monitor
.IppetPath())
18 @decorators.Enabled('win')
19 def testIppetRunsWithoutErrors(self
):
20 # Very basic test, doesn't validate any output data.
21 platform_backend
= win_platform_backend
.WinPlatformBackend()
22 power_monitor
= ippet_power_monitor
.IppetPowerMonitor(platform_backend
)
23 if not power_monitor
.CanMonitorPower():
24 logging
.warning('Test not supported on this platform.')
27 power_monitor
.StartMonitoringPower(None)
28 statistics
= power_monitor
.StopMonitoringPower()
30 self
.assertEqual(statistics
['identifier'], 'ippet')