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

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

Issue 798483004: Implement FlushSystemCacheForDirectory for Chrome OS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove |ignoring| Created 6 years 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/cros_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/cros_platform_backend.py b/tools/telemetry/telemetry/core/platform/cros_platform_backend.py
index e3d41c4ef030f91803995d00e23ee915322aa77a..c15c6f7802a3e1d544e4daac293b8b50b45797c4 100644
--- a/tools/telemetry/telemetry/core/platform/cros_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/cros_platform_backend.py
@@ -46,7 +46,10 @@ class CrosPlatformBackend(
raise NotImplementedError()
def RunCommand(self, args):
- return self._cri.RunCmdOnDevice(args)[0]
+ stdout, stderr = self._cri.RunCmdOnDevice(args)
+ if stderr:
+ raise RuntimeError(stderr)
+ return stdout
def GetFileContents(self, filename):
try:
@@ -106,8 +109,11 @@ class CrosPlatformBackend(
def FlushEntireSystemCache(self):
raise NotImplementedError()
- def FlushSystemCacheForDirectory(self, directory, ignoring=None):
- raise NotImplementedError()
+ def FlushSystemCacheForDirectory(self, directory):
+ flush_command = (
+ '/usr/local/telemetry/src/src/out/Release/clear_system_cache')
+ self.RunCommand(['chmod', '+x', flush_command])
+ self.RunCommand([flush_command, '--recurse', directory])
def CanMonitorPower(self):
return self._powermonitor.CanMonitorPower()

Powered by Google App Engine
This is Rietveld 408576698