Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py

Issue 1057563002: [Android] Convert to BatteryUtils (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py
diff --git a/tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py b/tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py
index 2a08ea395f82e981547a7114e7ca31e6cf9cc199..14b7c3b03e27bbe213d652646f9c52ed8738ae0f 100644
--- a/tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py
+++ b/tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py
@@ -4,12 +4,17 @@
import unittest
+from telemetry.core import util
from telemetry.core.platform import android_device
from telemetry.core.platform import android_platform_backend
from telemetry import decorators
from telemetry.unittest_util import options_for_unittests
from telemetry.unittest_util import system_stub
+util.AddDirToPythonPath(util.GetTelemetryDir(), 'third_party', 'mock')
+import mock # pylint: disable=F0401
+util.AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'android')
+from pylib.device import battery_utils # pylint: disable=F0401
class AndroidPlatformBackendTest(unittest.TestCase):
def setUp(self):
@@ -22,10 +27,13 @@ class AndroidPlatformBackendTest(unittest.TestCase):
# Skip _FixPossibleAdbInstability by setting psutil to None.
self._actual_ps_util = android_platform_backend.psutil
android_platform_backend.psutil = None
+ self.battery_patcher = mock.patch.object(battery_utils, 'BatteryUtils')
+ self.battery_patcher.start()
def tearDown(self):
self._stubs.Restore()
android_platform_backend.psutil = self._actual_ps_util
+ self.battery_patcher.stop()
@decorators.Disabled('chromeos')
def testGetCpuStats(self):

Powered by Google App Engine
This is Rietveld 408576698