Commit 7867b9e5 authored by achuith@chromium.org's avatar achuith@chromium.org

Make _output_profile_path a member of ChromeBrowserBackend.

This removes access of finder_options.output_profile_path from android_browser_backend.

BUG=269131
TEST=trybot

Review URL: https://chromiumcodereview.appspot.com/23466013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221870 0039d316-1c4b-4281-b951-d872f2087c98
parent a83f34d8
......@@ -147,10 +147,11 @@ class WebviewBackendSettings(AndroidBrowserBackendSettings):
class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
"""The backend for controlling a browser instance running on Android.
"""
def __init__(self, finder_options, backend_settings):
def __init__(self, finder_options, backend_settings, output_profile_path):
super(AndroidBrowserBackend, self).__init__(
is_content_shell=backend_settings.is_content_shell,
supports_extensions=False, finder_options=finder_options)
supports_extensions=False, finder_options=finder_options,
output_profile_path=output_profile_path)
if len(finder_options.extensions_to_load) > 0:
raise browser_backend.ExtensionsNotSupportedException(
'Android browser does not support extensions.')
......@@ -298,14 +299,14 @@ class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
self._SetCommandLineFile(self._saved_cmdline or '')
self._adb.CloseApplication(self._backend_settings.package)
if self.finder_options.output_profile_path:
logging.info("Pulling profile directory from device: '%s'->'%s'." %
(self._backend_settings.profile_dir,
self.finder_options.output_profile_path))
if self._output_profile_path:
logging.info("Pulling profile directory from device: '%s'->'%s'.",
self._backend_settings.profile_dir,
self._output_profile_path)
# To minimize bandwidth it might be good to look at whether all the data
# pulled down is really needed e.g. .pak files.
self._adb.Pull(self._backend_settings.profile_dir,
self.finder_options.output_profile_path)
self._output_profile_path)
def IsBrowserRunning(self):
pids = self._adb.ExtractPid(self._backend_settings.package)
......
......@@ -52,7 +52,8 @@ class PossibleAndroidBrowser(possible_browser.PossibleBrowser):
def Create(self):
backend = android_browser_backend.AndroidBrowserBackend(
self.finder_options, self._backend_settings)
self.finder_options, self._backend_settings,
output_profile_path=self.finder_options.output_profile_path)
platform_backend = android_platform_backend.AndroidPlatformBackend(
self._backend_settings.adb.Adb(),
self.finder_options.no_performance_mode)
......
......@@ -28,7 +28,8 @@ class ChromeBrowserBackend(browser_backend.BrowserBackend):
once a remote-debugger port has been established."""
# It is OK to have abstract methods. pylint: disable=W0223
def __init__(self, is_content_shell, supports_extensions, finder_options):
def __init__(self, is_content_shell, supports_extensions, finder_options,
output_profile_path=None):
super(ChromeBrowserBackend, self).__init__(
is_content_shell=is_content_shell,
supports_extensions=supports_extensions,
......@@ -41,6 +42,8 @@ class ChromeBrowserBackend(browser_backend.BrowserBackend):
self._tracing_backend = None
self._system_info_backend = None
self._output_profile_path = output_profile_path
self.webpagereplay_local_http_port = util.GetAvailableLocalPort()
self.webpagereplay_local_https_port = util.GetAvailableLocalPort()
self.webpagereplay_remote_http_port = self.webpagereplay_local_http_port
......
......@@ -20,11 +20,12 @@ class DesktopBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
Mac or Windows.
"""
def __init__(self, finder_options, executable, flash_path, is_content_shell,
browser_directory, output_profile_path=None):
browser_directory, output_profile_path):
super(DesktopBrowserBackend, self).__init__(
is_content_shell=is_content_shell,
supports_extensions=not is_content_shell,
finder_options=finder_options)
finder_options=finder_options,
output_profile_path=output_profile_path)
# Initialize fields so that an explosion during init doesn't break in Close.
self._proc = None
......@@ -50,7 +51,6 @@ class DesktopBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
self._port = util.GetAvailableLocalPort()
self._profile_dir = None
self._supports_net_benchmarking = True
self._output_profile_path = output_profile_path
self._tmp_minidump_dir = tempfile.mkdtemp()
self._SetupProfile()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment