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 android browsers that can be controlled by telemetry.""" | 4 """Finds android browsers that can be controlled by telemetry.""" |
5 | 5 |
6 import os | 6 import os |
7 import logging as real_logging | 7 import logging as real_logging |
8 import re | 8 import re |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
(...skipping 27 matching lines...) Expand all Loading... |
38 # adb shell pm list packages | 38 # adb shell pm list packages |
39 # adb | 39 # adb |
40 # intents to run (pass -D url for the rest) | 40 # intents to run (pass -D url for the rest) |
41 # com.android.chrome/.Main | 41 # com.android.chrome/.Main |
42 # com.google.android.apps.chrome/.Main | 42 # com.google.android.apps.chrome/.Main |
43 | 43 |
44 class PossibleAndroidBrowser(possible_browser.PossibleBrowser): | 44 class PossibleAndroidBrowser(possible_browser.PossibleBrowser): |
45 """A launchable android browser instance.""" | 45 """A launchable android browser instance.""" |
46 def __init__(self, browser_type, options, *args): | 46 def __init__(self, browser_type, options, *args): |
47 super(PossibleAndroidBrowser, self).__init__( | 47 super(PossibleAndroidBrowser, self).__init__( |
48 browser_type, options) | 48 browser_type, options, False) |
49 self._args = args | 49 self._args = args |
50 | 50 |
51 def __repr__(self): | 51 def __repr__(self): |
52 return 'PossibleAndroidBrowser(browser_type=%s)' % self.browser_type | 52 return 'PossibleAndroidBrowser(browser_type=%s)' % self.browser_type |
53 | 53 |
54 def Create(self): | 54 def Create(self): |
55 backend = android_browser_backend.AndroidBrowserBackend( | 55 backend = android_browser_backend.AndroidBrowserBackend( |
56 self._options, *self._args) | 56 self._options, *self._args) |
57 platform = android_platform.AndroidPlatform( | 57 platform = android_platform.AndroidPlatform( |
58 self._args[0].Adb(), self._args[1], | 58 self._args[0].Adb(), self._args[1], |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 # but make it accessible to the device. | 137 # but make it accessible to the device. |
138 if len(possible_browsers) and not adb_commands.HasForwarder(): | 138 if len(possible_browsers) and not adb_commands.HasForwarder(): |
139 logging.warn('telemetry detected an android device. However,') | 139 logging.warn('telemetry detected an android device. However,') |
140 logging.warn('Chrome\'s port-forwarder app is not available.') | 140 logging.warn('Chrome\'s port-forwarder app is not available.') |
141 logging.warn('To build:') | 141 logging.warn('To build:') |
142 logging.warn(' make -j16 host_forwarder device_forwarder') | 142 logging.warn(' make -j16 host_forwarder device_forwarder') |
143 logging.warn('') | 143 logging.warn('') |
144 logging.warn('') | 144 logging.warn('') |
145 return [] | 145 return [] |
146 return possible_browsers | 146 return possible_browsers |
OLD | NEW |