OLD | NEW |
| (Empty) |
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. | |
4 | |
5 import logging | |
6 import time | |
7 import unittest | |
8 | |
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 | |
12 | |
13 | |
14 class MsrPowerMonitorTest(unittest.TestCase): | |
15 @decorators.Disabled('all') # http://crbug.com/712486 | |
16 #@decorators.Enabled('xp', 'win7', 'win8') # http://crbug.com/479337 | |
17 def testMsrRuns(self): | |
18 platform_backend = win_platform_backend.WinPlatformBackend() | |
19 power_monitor = msr_power_monitor.MsrPowerMonitorWin(platform_backend) | |
20 if not power_monitor.CanMonitorPower(): | |
21 logging.warning('Test not supported on this platform.') | |
22 return | |
23 | |
24 power_monitor.StartMonitoringPower(None) | |
25 time.sleep(0.01) | |
26 statistics = power_monitor.StopMonitoringPower() | |
27 | |
28 self.assertEqual(statistics['identifier'], 'msr') | |
29 self.assertIn('energy_consumption_mwh', statistics) | |
30 self.assertGreater(statistics['energy_consumption_mwh'], 0) | |
OLD | NEW |