| 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 import logging as real_logging | 4 import logging as real_logging |
| 5 import os | 5 import os |
| 6 import sys | 6 import sys |
| 7 | 7 |
| 8 from telemetry.core import discover | 8 from telemetry.core import discover |
| 9 from telemetry.core import local_server | 9 from telemetry.core import local_server |
| 10 from telemetry.core import memory_cache_http_server | 10 from telemetry.core import memory_cache_http_server |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 164 |
| 165 This function does not require root or administrator access.""" | 165 This function does not require root or administrator access.""" |
| 166 return self._platform_backend.FlushSystemCacheForDirectory(directory) | 166 return self._platform_backend.FlushSystemCacheForDirectory(directory) |
| 167 | 167 |
| 168 def FlushDnsCache(self): | 168 def FlushDnsCache(self): |
| 169 """Flushes the OS's DNS cache completely. | 169 """Flushes the OS's DNS cache completely. |
| 170 | 170 |
| 171 This function may require root or administrator access.""" | 171 This function may require root or administrator access.""" |
| 172 return self._platform_backend.FlushDnsCache() | 172 return self._platform_backend.FlushDnsCache() |
| 173 | 173 |
| 174 def CanElevatePrivilege(self): |
| 175 """Returns true if root or admin rights are available on the platform.""" |
| 176 return self._platform_backend.CanElevatePrivilege() |
| 177 |
| 174 def LaunchApplication(self, | 178 def LaunchApplication(self, |
| 175 application, | 179 application, |
| 176 parameters=None, | 180 parameters=None, |
| 177 elevate_privilege=False): | 181 elevate_privilege=False): |
| 178 """"Launches the given |application| with a list of |parameters| on the OS. | 182 """"Launches the given |application| with a list of |parameters| on the OS. |
| 179 | 183 |
| 180 Set |elevate_privilege| to launch the application with root or admin rights. | 184 Set |elevate_privilege| to launch the application with root or admin rights. |
| 181 | 185 |
| 182 Returns: | 186 Returns: |
| 183 A popen style process handle for host platforms. | 187 A popen style process handle for host platforms. |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 def StopAllLocalServers(self): | 398 def StopAllLocalServers(self): |
| 395 self._local_server_controller.Close() | 399 self._local_server_controller.Close() |
| 396 | 400 |
| 397 @property | 401 @property |
| 398 def local_servers(self): | 402 def local_servers(self): |
| 399 """Returns the currently running local servers.""" | 403 """Returns the currently running local servers.""" |
| 400 return self._local_server_controller.local_servers | 404 return self._local_server_controller.local_servers |
| 401 | 405 |
| 402 def HasBattOrConnected(self): | 406 def HasBattOrConnected(self): |
| 403 return self._platform_backend.HasBattOrConnected() | 407 return self._platform_backend.HasBattOrConnected() |
| OLD | NEW |