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

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: Add abstract base platform_backend 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 1f2b61ef2ae31c7cf5050633a5f6b3bffdbc26ea..763e5b508869160317b1094aae5faf3f4f9d3496 100644
--- a/tools/telemetry/telemetry/core/chrome/cros_browser_backend.py
+++ b/tools/telemetry/telemetry/core/chrome/cros_browser_backend.py
@@ -87,6 +87,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 0
dtu 2013/03/04 23:26:15 None
+
def GetRemotePort(self, _):
return self._cri.GetRemotePort()
@@ -125,10 +132,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