Exposes the chrome instance used by chromedriver instance.
There are cases where clients of chromedriver.ChromeDriver objects
need to use Chrome to create tabs and do some kind of verification.
We can use the same chrome object that the driver already, while
the driver is active and hasn't been closed.
That way we can avoid creating a new logging session.
Example: crosreview.com/304081 will need this feature.
BUG=None.
TEST=None.
Change-Id: I261efd8c2ce5f998ff70881cf091c6af950c3586
Reviewed-on: https://chromium-review.googlesource.com/307561
Commit-Ready: Mussa Kiroga <mussa@chromium.org>
Tested-by: Mussa Kiroga <mussa@chromium.org>
Reviewed-by: Mussa Kiroga <mussa@chromium.org>
diff --git a/client/common_lib/cros/chromedriver.py b/client/common_lib/cros/chromedriver.py
index a43453c..7971f6c 100644
--- a/client/common_lib/cros/chromedriver.py
+++ b/client/common_lib/cros/chromedriver.py
@@ -111,7 +111,6 @@
self._browser.Close()
del self._browser
-
def get_extension(self, extension_path):
"""Gets an extension by proxying to the browser.
@@ -122,6 +121,12 @@
return self._chrome.get_extension(extension_path)
+ @property
+ def chrome_instance(self):
+ """ The chrome instance used by this chrome driver instance. """
+ return self._chrome
+
+
class chromedriver_server(object):
"""A running ChromeDriver server.