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

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

Issue 11412238: Proof of concept for running extension API stack through dev tools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/cros_browser_backend.py
diff --git a/tools/telemetry/telemetry/cros_browser_backend.py b/tools/telemetry/telemetry/cros_browser_backend.py
index 0e89334bc665aa8994703b467d166e4ba7e1c4bf..7347d5177916c6c450b0623d2ce96016760e1f0b 100644
--- a/tools/telemetry/telemetry/cros_browser_backend.py
+++ b/tools/telemetry/telemetry/cros_browser_backend.py
@@ -20,6 +20,7 @@ class CrOSBrowserBackend(browser_backend.BrowserBackend):
self._remote_debugging_port = self._cri.GetRemotePort()
self._login_ext_dir = '/tmp/chromeos_login_ext'
+ self._auto_ext_dir = '/tmp/auto_provider'
# Ensure the UI is running and logged out.
self._RestartUI()
@@ -36,6 +37,14 @@ class CrOSBrowserBackend(browser_backend.BrowserBackend):
cri.PushFile(
os.path.join(os.path.dirname(__file__), 'chromeos_login_ext'), '/tmp/')
cri.GetCmdOutput(['chown', '-R', 'chronos:chronos', self._login_ext_dir])
+ # Push the automation provider extension to the device.
nduca 2012/12/07 19:23:47 looks like you forgot to make this file do the ite
zel 2012/12/12 21:03:42 iteration? what iteration?
+ # TODO(zelidrag): Make a call if this component should live in rootfs
+ # of CrOS test images or be pushed over the wire this way.
+ logging.info('Copying automation provider extension to the device')
+ cri.PushFile(
+ os.path.join(os.path.dirname(__file__), '..', '..', 'telemetry_auto',
+ 'data', 'auto_provider'), '/tmp/')
+ cri.GetCmdOutput(['chown', '-R', 'chronos:chronos', self._auto_ext_dir])
# Restart Chrome with the login extension and remote debugging.
logging.info('Restarting Chrome with flags and login')
@@ -88,6 +97,7 @@ class CrOSBrowserBackend(browser_backend.BrowserBackend):
'--force-compositing-mode',
'--remote-debugging-port=%i' % self._remote_debugging_port,
'--auth-ext-path=%s' % self._login_ext_dir,
+ '--load-component-extension=%s' % self._auto_ext_dir,
'--start-maximized'])
return args
@@ -106,6 +116,10 @@ class CrOSBrowserBackend(browser_backend.BrowserBackend):
self._cri.RmRF(self._login_ext_dir)
self._login_ext_dir = None
+ if self._auto_ext_dir:
+ self._cri.RmRF(self._auto_ext_dir)
+ self._auto_ext_dir = None
+
self._cri = None
def IsBrowserRunning(self):

Powered by Google App Engine
This is Rietveld 408576698