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 | 4 |
5 """Defines a set of constants shared by test runners and other scripts.""" | 5 """Defines a set of constants shared by test runners and other scripts.""" |
6 | 6 |
7 # TODO(jbudorick): Split these constants into coherent modules. | 7 # TODO(jbudorick): Split these constants into coherent modules. |
8 | 8 |
9 # pylint: disable=W0212 | 9 # pylint: disable=W0212 |
10 | 10 |
11 import collections | 11 import collections |
12 import glob | 12 import glob |
13 import logging | 13 import logging |
14 import os | 14 import os |
15 import subprocess | 15 import subprocess |
16 | 16 |
17 import devil.android.sdk.keyevent | 17 import devil.android.sdk.keyevent |
18 from devil.android.sdk import version_codes | 18 from devil.android.sdk import version_codes |
19 from devil.constants import exit_codes | 19 from devil.constants import exit_codes |
20 | 20 |
21 | 21 |
22 keyevent = devil.android.sdk.keyevent | 22 keyevent = devil.android.sdk.keyevent |
23 | 23 |
24 | 24 |
25 DIR_SOURCE_ROOT = os.environ.get('CHECKOUT_SOURCE_ROOT', | 25 DIR_SOURCE_ROOT = os.environ.get('CHECKOUT_SOURCE_ROOT', |
26 os.path.abspath(os.path.join(os.path.dirname(__file__), | 26 os.path.abspath(os.path.join(os.path.dirname(__file__), |
27 os.pardir, os.pardir, os.pardir, os.pardir))) | 27 os.pardir, os.pardir, os.pardir, os.pardir))) |
28 | 28 |
29 PackageInfo = collections.namedtuple('PackageInfo', | 29 PackageInfo = collections.namedtuple('PackageInfo', |
30 ['package', 'activity', 'cmdline_file', 'devtools_socket']) | 30 ['package', 'activity', 'cmdline_file', 'devtools_socket', |
| 31 'test_package']) |
31 | 32 |
32 PACKAGE_INFO = { | 33 PACKAGE_INFO = { |
33 'chrome_document': PackageInfo( | 34 'chrome_document': PackageInfo( |
34 'com.google.android.apps.chrome.document', | 35 'com.google.android.apps.chrome.document', |
35 'com.google.android.apps.chrome.document.ChromeLauncherActivity', | 36 'com.google.android.apps.chrome.document.ChromeLauncherActivity', |
36 '/data/local/chrome-command-line', | 37 '/data/local/chrome-command-line', |
37 'chrome_devtools_remote'), | 38 'chrome_devtools_remote', |
| 39 None), |
38 'chrome': PackageInfo( | 40 'chrome': PackageInfo( |
39 'com.google.android.apps.chrome', | 41 'com.google.android.apps.chrome', |
40 'com.google.android.apps.chrome.Main', | 42 'com.google.android.apps.chrome.Main', |
41 '/data/local/chrome-command-line', | 43 '/data/local/chrome-command-line', |
42 'chrome_devtools_remote'), | 44 'chrome_devtools_remote', |
| 45 'com.google.android.apps.chrome.tests'), |
43 'chrome_beta': PackageInfo( | 46 'chrome_beta': PackageInfo( |
44 'com.chrome.beta', | 47 'com.chrome.beta', |
45 'com.google.android.apps.chrome.Main', | 48 'com.google.android.apps.chrome.Main', |
46 '/data/local/chrome-command-line', | 49 '/data/local/chrome-command-line', |
47 'chrome_devtools_remote'), | 50 'chrome_devtools_remote', |
| 51 None), |
48 'chrome_stable': PackageInfo( | 52 'chrome_stable': PackageInfo( |
49 'com.android.chrome', | 53 'com.android.chrome', |
50 'com.google.android.apps.chrome.Main', | 54 'com.google.android.apps.chrome.Main', |
51 '/data/local/chrome-command-line', | 55 '/data/local/chrome-command-line', |
52 'chrome_devtools_remote'), | 56 'chrome_devtools_remote', |
| 57 None), |
53 'chrome_dev': PackageInfo( | 58 'chrome_dev': PackageInfo( |
54 'com.chrome.dev', | 59 'com.chrome.dev', |
55 'com.google.android.apps.chrome.Main', | 60 'com.google.android.apps.chrome.Main', |
56 '/data/local/chrome-command-line', | 61 '/data/local/chrome-command-line', |
57 'chrome_devtools_remote'), | 62 'chrome_devtools_remote', |
| 63 None), |
58 'chrome_canary': PackageInfo( | 64 'chrome_canary': PackageInfo( |
59 'com.chrome.canary', | 65 'com.chrome.canary', |
60 'com.google.android.apps.chrome.Main', | 66 'com.google.android.apps.chrome.Main', |
61 '/data/local/chrome-command-line', | 67 '/data/local/chrome-command-line', |
62 'chrome_devtools_remote'), | 68 'chrome_devtools_remote', |
| 69 None), |
63 'chrome_work': PackageInfo( | 70 'chrome_work': PackageInfo( |
64 'com.chrome.work', | 71 'com.chrome.work', |
65 'com.google.android.apps.chrome.Main', | 72 'com.google.android.apps.chrome.Main', |
66 '/data/local/chrome-command-line', | 73 '/data/local/chrome-command-line', |
67 'chrome_devtools_remote'), | 74 'chrome_devtools_remote', |
| 75 None), |
68 'chromium': PackageInfo( | 76 'chromium': PackageInfo( |
69 'org.chromium.chrome', | 77 'org.chromium.chrome', |
70 'com.google.android.apps.chrome.Main', | 78 'com.google.android.apps.chrome.Main', |
71 '/data/local/chrome-command-line', | 79 '/data/local/chrome-command-line', |
72 'chrome_devtools_remote'), | 80 'chrome_devtools_remote', |
| 81 'org.chromium.chrome.tests'), |
73 'legacy_browser': PackageInfo( | 82 'legacy_browser': PackageInfo( |
74 'com.google.android.browser', | 83 'com.google.android.browser', |
75 'com.android.browser.BrowserActivity', | 84 'com.android.browser.BrowserActivity', |
76 None, | 85 None, |
| 86 None, |
77 None), | 87 None), |
78 'chromecast_shell': PackageInfo( | 88 'chromecast_shell': PackageInfo( |
79 'com.google.android.apps.mediashell', | 89 'com.google.android.apps.mediashell', |
80 'com.google.android.apps.mediashell.MediaShellActivity', | 90 'com.google.android.apps.mediashell.MediaShellActivity', |
81 '/data/local/tmp/castshell-command-line', | 91 '/data/local/tmp/castshell-command-line', |
| 92 None, |
82 None), | 93 None), |
83 'content_shell': PackageInfo( | 94 'content_shell': PackageInfo( |
84 'org.chromium.content_shell_apk', | 95 'org.chromium.content_shell_apk', |
85 'org.chromium.content_shell_apk.ContentShellActivity', | 96 'org.chromium.content_shell_apk.ContentShellActivity', |
86 '/data/local/tmp/content-shell-command-line', | 97 '/data/local/tmp/content-shell-command-line', |
87 None), | 98 None, |
| 99 'org.chromium.content_shell_apk.tests'), |
88 'android_webview_shell': PackageInfo( | 100 'android_webview_shell': PackageInfo( |
89 'org.chromium.android_webview.shell', | 101 'org.chromium.android_webview.shell', |
90 'org.chromium.android_webview.shell.AwShellActivity', | 102 'org.chromium.android_webview.shell.AwShellActivity', |
91 '/data/local/tmp/android-webview-command-line', | 103 '/data/local/tmp/android-webview-command-line', |
92 None), | 104 None, |
| 105 'org.chromium.android_webview.test'), |
93 'gtest': PackageInfo( | 106 'gtest': PackageInfo( |
94 'org.chromium.native_test', | 107 'org.chromium.native_test', |
95 'org.chromium.native_test.NativeUnitTestActivity', | 108 'org.chromium.native_test.NativeUnitTestActivity', |
96 '/data/local/tmp/chrome-native-tests-command-line', | 109 '/data/local/tmp/chrome-native-tests-command-line', |
| 110 None, |
97 None), | 111 None), |
98 'components_browsertests': PackageInfo( | 112 'components_browsertests': PackageInfo( |
99 'org.chromium.components_browsertests_apk', | 113 'org.chromium.components_browsertests_apk', |
100 ('org.chromium.components_browsertests_apk' + | 114 ('org.chromium.components_browsertests_apk' + |
101 '.ComponentsBrowserTestsActivity'), | 115 '.ComponentsBrowserTestsActivity'), |
102 '/data/local/tmp/chrome-native-tests-command-line', | 116 '/data/local/tmp/chrome-native-tests-command-line', |
| 117 None, |
103 None), | 118 None), |
104 'content_browsertests': PackageInfo( | 119 'content_browsertests': PackageInfo( |
105 'org.chromium.content_browsertests_apk', | 120 'org.chromium.content_browsertests_apk', |
106 'org.chromium.content_browsertests_apk.ContentBrowserTestsActivity', | 121 'org.chromium.content_browsertests_apk.ContentBrowserTestsActivity', |
107 '/data/local/tmp/chrome-native-tests-command-line', | 122 '/data/local/tmp/chrome-native-tests-command-line', |
| 123 None, |
108 None), | 124 None), |
109 'chromedriver_webview_shell': PackageInfo( | 125 'chromedriver_webview_shell': PackageInfo( |
110 'org.chromium.chromedriver_webview_shell', | 126 'org.chromium.chromedriver_webview_shell', |
111 'org.chromium.chromedriver_webview_shell.Main', | 127 'org.chromium.chromedriver_webview_shell.Main', |
112 None, | 128 None, |
| 129 None, |
113 None), | 130 None), |
114 } | 131 } |
115 | 132 |
116 | 133 |
117 # Ports arrangement for various test servers used in Chrome for Android. | 134 # Ports arrangement for various test servers used in Chrome for Android. |
118 # Lighttpd server will attempt to use 9000 as default port, if unavailable it | 135 # Lighttpd server will attempt to use 9000 as default port, if unavailable it |
119 # will find a free port from 8001 - 8999. | 136 # will find a free port from 8001 - 8999. |
120 LIGHTTPD_DEFAULT_PORT = 9000 | 137 LIGHTTPD_DEFAULT_PORT = 9000 |
121 LIGHTTPD_RANDOM_PORT_FIRST = 8001 | 138 LIGHTTPD_RANDOM_PORT_FIRST = 8001 |
122 LIGHTTPD_RANDOM_PORT_LAST = 8999 | 139 LIGHTTPD_RANDOM_PORT_LAST = 8999 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 # remove this. | 279 # remove this. |
263 def GetAdbPath(): | 280 def GetAdbPath(): |
264 from devil.android.sdk import adb_wrapper | 281 from devil.android.sdk import adb_wrapper |
265 return adb_wrapper.AdbWrapper.GetAdbPath() | 282 return adb_wrapper.AdbWrapper.GetAdbPath() |
266 | 283 |
267 | 284 |
268 # Exit codes | 285 # Exit codes |
269 ERROR_EXIT_CODE = exit_codes.ERROR | 286 ERROR_EXIT_CODE = exit_codes.ERROR |
270 INFRA_EXIT_CODE = exit_codes.INFRA | 287 INFRA_EXIT_CODE = exit_codes.INFRA |
271 WARNING_EXIT_CODE = exit_codes.WARNING | 288 WARNING_EXIT_CODE = exit_codes.WARNING |
OLD | NEW |