Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / core / platform / platform_backend_unittest.py
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 unittest
7
8 from telemetry.core import platform
9
10
11 class PlatformBackendTest(unittest.TestCase):
12   def testPowerMonitoringSync(self):
13     # Tests that the act of monitoring power doesn't blow up.
14     backend = platform.CreatePlatformBackendForCurrentOS()
15     if not backend.CanMonitorPowerSync():
16       logging.warning('Test not supported on this platform.')
17       return
18
19     output = backend.MonitorPowerSync(1)
20     self.assertTrue(output.has_key('power_samples_mw'))
21     self.assertTrue(output.has_key('identifier'))