Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / core / platform / android_platform_backend_unittest.py
index 3a47b31..dce2c87 100644 (file)
@@ -4,7 +4,7 @@
 
 import unittest
 
-from telemetry import test
+from telemetry import benchmark
 from telemetry.core.platform import android_platform_backend
 from telemetry.unittest import system_stub
 
@@ -34,6 +34,14 @@ class MockDevice(object):
   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):
@@ -43,7 +51,7 @@ class AndroidPlatformBackendTest(unittest.TestCase):
   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 '
@@ -57,7 +65,7 @@ class AndroidPlatformBackendTest(unittest.TestCase):
     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([], {}))
@@ -65,4 +73,3 @@ class AndroidPlatformBackendTest(unittest.TestCase):
         adb_empty_proc_stat, False)
     cpu_stats = backend.GetCpuStats('7702')
     self.assertEquals(cpu_stats, {})
-