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

Side by Side Diff: tools/telemetry/telemetry/android_browser_finder.py

Issue 11841008: Telemetry: fixes SurfaceStatsCollector usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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 12 matching lines...) Expand all
23 } 23 }
24 24
25 ALL_BROWSER_TYPES = ','.join(['android-content-shell'] + 25 ALL_BROWSER_TYPES = ','.join(['android-content-shell'] +
26 CHROME_PACKAGE_NAMES.keys()) 26 CHROME_PACKAGE_NAMES.keys())
27 27
28 CHROME_ACTIVITY = 'com.google.android.apps.chrome.Main' 28 CHROME_ACTIVITY = 'com.google.android.apps.chrome.Main'
29 CHROME_COMMAND_LINE = '/data/local/chrome-command-line' 29 CHROME_COMMAND_LINE = '/data/local/chrome-command-line'
30 CHROME_DEVTOOLS_REMOTE_PORT = 'localabstract:chrome_devtools_remote' 30 CHROME_DEVTOOLS_REMOTE_PORT = 'localabstract:chrome_devtools_remote'
31 31
32 CONTENT_SHELL_PACKAGE = 'org.chromium.content_shell' 32 CONTENT_SHELL_PACKAGE = 'org.chromium.content_shell'
33 CONTENT_SHELL_ACTIVITY = '.ContentShellActivity' 33 CONTENT_SHELL_ACTIVITY = 'org.chromium.content_shell.ContentShellActivity'
34 CONTENT_SHELL_COMMAND_LINE = '/data/local/tmp/content-shell-command-line' 34 CONTENT_SHELL_COMMAND_LINE = '/data/local/tmp/content-shell-command-line'
35 CONTENT_SHELL_DEVTOOLS_REMOTE_PORT = ( 35 CONTENT_SHELL_DEVTOOLS_REMOTE_PORT = (
36 'localabstract:content_shell_devtools_remote') 36 'localabstract:content_shell_devtools_remote')
37 37
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)
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],
59 self._args[1] + self._args[4]) 59 self._args[4])
60 b = browser.Browser(backend, platform) 60 b = browser.Browser(backend, platform)
61 backend.SetBrowser(b) 61 backend.SetBrowser(b)
62 return b 62 return b
63 63
64 def FindAllAvailableBrowsers(options, logging=real_logging): 64 def FindAllAvailableBrowsers(options, logging=real_logging):
65 """Finds all the desktop browsers available on this machine.""" 65 """Finds all the desktop browsers available on this machine."""
66 if not adb_commands.IsAndroidSupported(): 66 if not adb_commands.IsAndroidSupported():
67 return [] 67 return []
68 68
69 # See if adb even works. 69 # See if adb even works.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698