| OLD | NEW |
| 1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import logging | 5 import logging |
| 6 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 from catapult_base import cloud_storage | 9 from catapult_base import cloud_storage |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 browser_to_create = FindBrowser(options) | 32 browser_to_create = FindBrowser(options) |
| 33 with browser_to_create.Create(options) as browser: | 33 with browser_to_create.Create(options) as browser: |
| 34 ... do all your operations on browser here | 34 ... do all your operations on browser here |
| 35 """ | 35 """ |
| 36 def __init__(self, backend, platform_backend, credentials_path): | 36 def __init__(self, backend, platform_backend, credentials_path): |
| 37 super(Browser, self).__init__(app_backend=backend, | 37 super(Browser, self).__init__(app_backend=backend, |
| 38 platform_backend=platform_backend) | 38 platform_backend=platform_backend) |
| 39 try: | 39 try: |
| 40 self._browser_backend = backend | 40 self._browser_backend = backend |
| 41 self._platform_backend = platform_backend | 41 self._platform_backend = platform_backend |
| 42 # TODO: move _local_server_controller to Platform. |
| 42 self._local_server_controller = local_server.LocalServerController( | 43 self._local_server_controller = local_server.LocalServerController( |
| 43 platform_backend) | 44 platform_backend) |
| 44 self._tabs = tab_list.TabList(backend.tab_list_backend) | 45 self._tabs = tab_list.TabList(backend.tab_list_backend) |
| 45 self.credentials = browser_credentials.BrowserCredentials() | 46 self.credentials = browser_credentials.BrowserCredentials() |
| 46 self.credentials.credentials_path = credentials_path | 47 self.credentials.credentials_path = credentials_path |
| 47 self._platform_backend.DidCreateBrowser(self, self._browser_backend) | 48 self._platform_backend.DidCreateBrowser(self, self._browser_backend) |
| 48 browser_options = self._browser_backend.browser_options | 49 browser_options = self._browser_backend.browser_options |
| 49 self.platform.FlushDnsCache() | 50 self.platform.FlushDnsCache() |
| 50 if browser_options.clear_sytem_cache_for_browser_and_profile_on_start: | 51 if browser_options.clear_sytem_cache_for_browser_and_profile_on_start: |
| 51 if self.platform.CanFlushIndividualFilesFromSystemCache(): | 52 if self.platform.CanFlushIndividualFilesFromSystemCache(): |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 def supports_cpu_metrics(self): | 314 def supports_cpu_metrics(self): |
| 314 return self._browser_backend.supports_cpu_metrics | 315 return self._browser_backend.supports_cpu_metrics |
| 315 | 316 |
| 316 @property | 317 @property |
| 317 def supports_memory_metrics(self): | 318 def supports_memory_metrics(self): |
| 318 return self._browser_backend.supports_memory_metrics | 319 return self._browser_backend.supports_memory_metrics |
| 319 | 320 |
| 320 @property | 321 @property |
| 321 def supports_power_metrics(self): | 322 def supports_power_metrics(self): |
| 322 return self._browser_backend.supports_power_metrics | 323 return self._browser_backend.supports_power_metrics |
| OLD | NEW |