Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py

Issue 11428107: Telemetry: extends Platform abstraction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: __init__/close() Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 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 """Finds desktop browsers that can be controlled by telemetry.""" 4 """Finds desktop browsers that can be controlled by telemetry."""
5 5
6 import logging 6 import logging
7 import os 7 import os
8 import subprocess 8 import subprocess
9 import sys 9 import sys
10 10
(...skipping 18 matching lines...) Expand all
29 super(PossibleDesktopBrowser, self).__init__(browser_type, options) 29 super(PossibleDesktopBrowser, self).__init__(browser_type, options)
30 self._local_executable = executable 30 self._local_executable = executable
31 self._is_content_shell = is_content_shell 31 self._is_content_shell = is_content_shell
32 32
33 def __repr__(self): 33 def __repr__(self):
34 return 'PossibleDesktopBrowser(browser_type=%s)' % self.browser_type 34 return 'PossibleDesktopBrowser(browser_type=%s)' % self.browser_type
35 35
36 def Create(self): 36 def Create(self):
37 backend = desktop_browser_backend.DesktopBrowserBackend( 37 backend = desktop_browser_backend.DesktopBrowserBackend(
38 self._options, self._local_executable, self._is_content_shell) 38 self._options, self._local_executable, self._is_content_shell)
39 b = browser.Browser(backend, platform.Platform()) 39 b = browser.Browser(backend, platform.EmptyPlatform())
40 backend.SetBrowser(b) 40 backend.SetBrowser(b)
41 return b 41 return b
42 42
43 def SupportsOptions(self, options): 43 def SupportsOptions(self, options):
44 if (len(options.extensions_to_load) != 0) and self._is_content_shell: 44 if (len(options.extensions_to_load) != 0) and self._is_content_shell:
45 return False 45 return False
46 return True 46 return True
47 47
48 def FindAllAvailableBrowsers(options): 48 def FindAllAvailableBrowsers(options):
49 """Finds all the desktop browsers available on this machine.""" 49 """Finds all the desktop browsers available on this machine."""
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 chromium_app_name, False): 153 chromium_app_name, False):
154 break 154 break
155 155
156 if len(browsers) and not has_display: 156 if len(browsers) and not has_display:
157 logging.warning( 157 logging.warning(
158 'Found (%s), but you do not have a DISPLAY environment set.' % 158 'Found (%s), but you do not have a DISPLAY environment set.' %
159 ','.join([b.browser_type for b in browsers])) 159 ','.join([b.browser_type for b in browsers]))
160 return [] 160 return []
161 161
162 return browsers 162 return browsers
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698