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

Unified Diff: tools/telemetry/telemetry/unittest/system_stub.py

Issue 25002005: Telemetry / Android: do not crash on GetCpuStats() if the process is gone. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unittests! Created 7 years, 2 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
« no previous file with comments | « tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/unittest/system_stub.py
diff --git a/tools/telemetry/telemetry/unittest/system_stub.py b/tools/telemetry/telemetry/unittest/system_stub.py
index b647f5fb5930d35298b01610f1af91cb2a437043..922d37f266dbe097acf45e1281215069cdb38a0c 100644
--- a/tools/telemetry/telemetry/unittest/system_stub.py
+++ b/tools/telemetry/telemetry/unittest/system_stub.py
@@ -14,6 +14,8 @@ import sys as real_sys
class Override(object):
def __init__(self, base_module, module_list):
stubs = {'adb_commands': AdbCommandsModuleStub,
+ 'perf_control': PerfControlModuleStub,
+ 'thermal_throttle': ThermalThrottleModuleStub,
'os': OsModuleStub,
'subprocess': SubprocessModuleStub,
'sys': SysModuleStub,
@@ -79,6 +81,24 @@ class AdbCommandsModuleStub(object):
def HasForwarder(_=None):
return True
+class PerfControlModuleStub(object):
+ class PerfControlStub(object):
+ def __init__(self, adb):
+ pass
+
+ def __init__(self):
+ self.PerfControl = PerfControlModuleStub.PerfControlStub
+
+
+class ThermalThrottleModuleStub(object):
+ class ThermalThrottleStub(object):
+ def __init__(self, adb):
+ pass
+
+ def __init__(self):
+ self.ThermalThrottle = ThermalThrottleModuleStub.ThermalThrottleStub
+
+
class OsModuleStub(object):
class OsPathModuleStub(object):
def __init__(self, sys_module):
« no previous file with comments | « tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698