| Index: tools/telemetry/telemetry/core/browser.py
|
| diff --git a/tools/telemetry/telemetry/core/browser.py b/tools/telemetry/telemetry/core/browser.py
|
| index dca7a06176cbddf9d2d4909e42a9d185f97ec2e3..2d290a9b79ecb662bac2f73420623270391d25f7 100644
|
| --- a/tools/telemetry/telemetry/core/browser.py
|
| +++ b/tools/telemetry/telemetry/core/browser.py
|
| @@ -27,9 +27,7 @@
|
| with browser_to_create.Create() as browser:
|
| ... do all your operations on browser here
|
| """
|
| - def __init__(self, backend, platform_backend, archive_path,
|
| - append_to_existing_wpr, make_javascript_deterministic,
|
| - credentials_path):
|
| + def __init__(self, backend, platform_backend):
|
| assert platform_backend.platform != None
|
|
|
| self._browser_backend = backend
|
| @@ -38,29 +36,10 @@
|
| self._local_server_controller = local_server.LocalServerController(backend)
|
| self._tabs = tab_list.TabList(backend.tab_list_backend)
|
| self.credentials = browser_credentials.BrowserCredentials()
|
| - self.credentials.credentials_path = credentials_path
|
| self._platform_backend.DidCreateBrowser(self, self._browser_backend)
|
|
|
| - self.SetReplayArchivePath(archive_path,
|
| - append_to_existing_wpr,
|
| - make_javascript_deterministic)
|
| -
|
| - browser_options = self._browser_backend.browser_options
|
| - self.platform.FlushDnsCache()
|
| - if browser_options.clear_sytem_cache_for_browser_and_profile_on_start:
|
| - if self.platform.CanFlushIndividualFilesFromSystemCache():
|
| - self.platform.FlushSystemCacheForDirectory(
|
| - self._browser_backend.profile_directory)
|
| - self.platform.FlushSystemCacheForDirectory(
|
| - self._browser_backend.browser_directory)
|
| - else:
|
| - self.platform.FlushEntireSystemCache()
|
| -
|
| - self._browser_backend.SetBrowser(self)
|
| - self._browser_backend.Start()
|
| - self._platform_backend.DidStartBrowser(self, self._browser_backend)
|
| -
|
| def __enter__(self):
|
| + self.Start()
|
| return self
|
|
|
| def __exit__(self, *args):
|
| @@ -251,6 +230,22 @@
|
| del result['ProcessCount']
|
| return result
|
|
|
| + def Start(self):
|
| + browser_options = self._browser_backend.browser_options
|
| + self.platform.FlushDnsCache()
|
| + if browser_options.clear_sytem_cache_for_browser_and_profile_on_start:
|
| + if self.platform.CanFlushIndividualFilesFromSystemCache():
|
| + self.platform.FlushSystemCacheForDirectory(
|
| + self._browser_backend.profile_directory)
|
| + self.platform.FlushSystemCacheForDirectory(
|
| + self._browser_backend.browser_directory)
|
| + else:
|
| + self.platform.FlushEntireSystemCache()
|
| +
|
| + self._browser_backend.SetBrowser(self)
|
| + self._browser_backend.Start()
|
| + self._platform_backend.DidStartBrowser(self, self._browser_backend)
|
| +
|
| def Close(self):
|
| """Closes this browser."""
|
| if self._browser_backend.IsBrowserRunning():
|
|
|