OLD | NEW |
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 browsers that can be controlled by chrome_remote_control.""" |
| 5 |
4 import logging | 6 import logging |
5 | 7 |
6 from chrome_remote_control import android_browser_finder | 8 from chrome_remote_control import android_browser_finder |
7 from chrome_remote_control import cros_browser_finder | 9 from chrome_remote_control import cros_browser_finder |
8 from chrome_remote_control import desktop_browser_finder | 10 from chrome_remote_control import desktop_browser_finder |
9 | 11 |
10 """Finds browsers that can be controlled by chrome_remote_control.""" | |
11 | |
12 ALL_BROWSER_TYPES = ( | 12 ALL_BROWSER_TYPES = ( |
13 desktop_browser_finder.ALL_BROWSER_TYPES + ',' + | 13 desktop_browser_finder.ALL_BROWSER_TYPES + ',' + |
14 android_browser_finder.ALL_BROWSER_TYPES + ',' + | 14 android_browser_finder.ALL_BROWSER_TYPES + ',' + |
15 cros_browser_finder.ALL_BROWSER_TYPES) | 15 cros_browser_finder.ALL_BROWSER_TYPES) |
16 | 16 |
17 class BrowserTypeRequiredException(Exception): | 17 class BrowserTypeRequiredException(Exception): |
18 pass | 18 pass |
19 | 19 |
20 def FindBrowser(options): | 20 def FindBrowser(options): |
21 """Finds the best PossibleBrowser object to run given the provided | 21 """Finds the best PossibleBrowser object to run given the provided |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 """Returns an array of browser types supported on this system.""" | 64 """Returns an array of browser types supported on this system.""" |
65 browsers = [] | 65 browsers = [] |
66 browsers.extend(desktop_browser_finder.FindAllAvailableBrowsers(options)) | 66 browsers.extend(desktop_browser_finder.FindAllAvailableBrowsers(options)) |
67 browsers.extend(android_browser_finder.FindAllAvailableBrowsers(options)) | 67 browsers.extend(android_browser_finder.FindAllAvailableBrowsers(options)) |
68 browsers.extend(cros_browser_finder.FindAllAvailableBrowsers(options)) | 68 browsers.extend(cros_browser_finder.FindAllAvailableBrowsers(options)) |
69 | 69 |
70 type_list = set([browser.browser_type for browser in browsers]) | 70 type_list = set([browser.browser_type for browser in browsers]) |
71 type_list = list(type_list) | 71 type_list = list(type_list) |
72 type_list.sort() | 72 type_list.sort() |
73 return type_list | 73 return type_list |
OLD | NEW |