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

Unified Diff: tools/telemetry/telemetry/core/chrome/cros_browser_backend.py

Issue 11576050: [Telemetry] Add memory and IO stats to page cycler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address dtu nits Created 7 years, 10 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/chrome/cros_browser_backend.py
diff --git a/tools/telemetry/telemetry/core/chrome/cros_browser_backend.py b/tools/telemetry/telemetry/core/chrome/cros_browser_backend.py
index 2aa82a531d345b0233afbcc164fc5a34bb02884c..bbe9f5cf31f39155a9a5c2809f79c969f06e03e1 100644
--- a/tools/telemetry/telemetry/core/chrome/cros_browser_backend.py
+++ b/tools/telemetry/telemetry/core/chrome/cros_browser_backend.py
@@ -95,6 +95,13 @@ class CrOSBrowserBackend(browser_backend.BrowserBackend):
'--start-maximized'])
return args
+ @property
+ def pid(self):
+ for pid, process in self._cri.ListProcesses():
+ if process.startswith('/opt/google/chrome/chrome '):
+ return int(pid)
+ return None
+
def GetRemotePort(self, _):
return self._cri.GetRemotePort()
@@ -121,10 +128,7 @@ class CrOSBrowserBackend(browser_backend.BrowserBackend):
def IsBrowserRunning(self):
# On ChromeOS, there should always be a browser running.
- for _, process in self._cri.ListProcesses():
- if process.startswith('/opt/google/chrome/chrome'):
- return True
- return False
+ return bool(self.pid)
def GetStandardOutput(self):
return 'Cannot get standard output on CrOS'

Powered by Google App Engine
This is Rietveld 408576698