import unittest
-from telemetry import test
+from telemetry import benchmark
from telemetry.core.platform import android_platform_backend
from telemetry.unittest import system_stub
def __init__(self, mock_adb_commands):
self.old_interface = mock_adb_commands
+ def ReadFile(self, device_path, as_root=False): # pylint: disable=W0613
+ return self.old_interface.GetProtectedFileContents(device_path)
+
+ def GetProp(self, property_name):
+ return self.old_interface.system_properties[property_name]
+
+ def SetProp(self, property_name, property_value):
+ self.old_interface.system_properties[property_name] = property_value
class AndroidPlatformBackendTest(unittest.TestCase):
def setUp(self):
def tearDown(self):
self._stubs.Restore()
- @test.Disabled('chromeos')
+ @benchmark.Disabled('chromeos')
def testGetCpuStats(self):
proc_stat_content = [
'7702 (.android.chrome) S 167 167 0 0 -1 1077936448 '
cpu_stats = backend.GetCpuStats('7702')
self.assertEquals(cpu_stats, {'CpuProcessTime': 5.0})
- @test.Disabled('chromeos')
+ @benchmark.Disabled('chromeos')
def testGetCpuStatsInvalidPID(self):
# Mock an empty /proc/pid/stat.
adb_empty_proc_stat = MockDevice(MockAdbCommands([], {}))
adb_empty_proc_stat, False)
cpu_stats = backend.GetCpuStats('7702')
self.assertEquals(cpu_stats, {})
-