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 import collections |
7 import os | 8 import os |
8 import subprocess | 9 import subprocess |
9 import sys | 10 import sys |
10 | 11 |
11 | 12 |
12 DIR_SOURCE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), | 13 DIR_SOURCE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), |
13 os.pardir, os.pardir, os.pardir)) | 14 os.pardir, os.pardir, os.pardir)) |
14 ISOLATE_DEPS_DIR = os.path.join(DIR_SOURCE_ROOT, 'isolate_deps_dir') | 15 ISOLATE_DEPS_DIR = os.path.join(DIR_SOURCE_ROOT, 'isolate_deps_dir') |
15 EMULATOR_SDK_ROOT = os.path.abspath(os.path.join(DIR_SOURCE_ROOT, os.pardir, | 16 EMULATOR_SDK_ROOT = os.path.abspath(os.path.join(DIR_SOURCE_ROOT, os.pardir, |
16 os.pardir)) | 17 os.pardir)) |
| 18 |
| 19 # TODO(craigdh): Remove these once references have been removed downstream. |
17 CHROME_PACKAGE = 'com.google.android.apps.chrome' | 20 CHROME_PACKAGE = 'com.google.android.apps.chrome' |
18 CHROME_ACTIVITY = 'com.google.android.apps.chrome.Main' | 21 CHROME_ACTIVITY = 'com.google.android.apps.chrome.Main' |
19 CHROME_DEVTOOLS_SOCKET = 'chrome_devtools_remote' | |
20 | 22 |
21 CHROME_STABLE_PACKAGE = 'com.android.chrome' | 23 CHROME_STABLE_PACKAGE = 'com.android.chrome' |
22 CHROME_BETA_PACKAGE = 'com.chrome.beta' | 24 CHROME_BETA_PACKAGE = 'com.chrome.beta' |
23 | 25 |
24 CHROME_TESTS_PACKAGE = 'com.google.android.apps.chrome.tests' | |
25 | |
26 LEGACY_BROWSER_PACKAGE = 'com.google.android.browser' | 26 LEGACY_BROWSER_PACKAGE = 'com.google.android.browser' |
27 LEGACY_BROWSER_ACTIVITY = 'com.android.browser.BrowserActivity' | 27 LEGACY_BROWSER_ACTIVITY = 'com.android.browser.BrowserActivity' |
28 | 28 |
29 CONTENT_SHELL_PACKAGE = 'org.chromium.content_shell_apk' | 29 CONTENT_SHELL_PACKAGE = 'org.chromium.content_shell_apk' |
30 CONTENT_SHELL_ACTIVITY = 'org.chromium.content_shell_apk.ContentShellActivity' | 30 CONTENT_SHELL_ACTIVITY = 'org.chromium.content_shell_apk.ContentShellActivity' |
31 | 31 |
32 CHROME_SHELL_PACKAGE = 'org.chromium.chrome.browser.test' | |
33 | |
34 CHROMIUM_TEST_SHELL_PACKAGE = 'org.chromium.chrome.testshell' | 32 CHROMIUM_TEST_SHELL_PACKAGE = 'org.chromium.chrome.testshell' |
35 CHROMIUM_TEST_SHELL_ACTIVITY = ( | 33 CHROMIUM_TEST_SHELL_ACTIVITY = ( |
36 'org.chromium.chrome.testshell.ChromiumTestShellActivity') | 34 'org.chromium.chrome.testshell.ChromiumTestShellActivity') |
37 CHROMIUM_TEST_SHELL_DEVTOOLS_SOCKET = 'chromium_testshell_devtools_remote' | 35 CHROMIUM_TEST_SHELL_DEVTOOLS_SOCKET = 'chromium_testshell_devtools_remote' |
38 CHROMIUM_TEST_SHELL_HOST_DRIVEN_DIR = os.path.join( | 36 CHROMIUM_TEST_SHELL_HOST_DRIVEN_DIR = os.path.join( |
39 DIR_SOURCE_ROOT, 'chrome', 'android') | 37 DIR_SOURCE_ROOT, 'chrome', 'android') |
40 | 38 |
41 GTEST_TEST_PACKAGE_NAME = 'org.chromium.native_test' | |
42 GTEST_TEST_ACTIVITY_NAME = 'org.chromium.native_test.ChromeNativeTestActivity' | |
43 GTEST_COMMAND_LINE_FILE = 'chrome-native-tests-command-line' | |
44 | 39 |
45 BROWSERTEST_TEST_PACKAGE_NAME = 'org.chromium.content_browsertests_apk' | 40 PackageInfo = collections.namedtuple('PackageInfo', |
46 BROWSERTEST_TEST_ACTIVITY_NAME = ( | 41 ['package', 'activity', 'cmdline_file', 'devtools_socket', |
47 'org.chromium.content_browsertests_apk.ContentBrowserTestsActivity') | 42 'test_package']) |
48 BROWSERTEST_COMMAND_LINE_FILE = 'content-browser-tests-command-line' | 43 |
| 44 PACKAGE_INFO = { |
| 45 'chrome': PackageInfo( |
| 46 CHROME_PACKAGE, |
| 47 CHROME_ACTIVITY, |
| 48 '/data/local/chrome-command-line', |
| 49 'chrome_devtools_remote', |
| 50 'com.google.android.apps.chrome.tests'), |
| 51 'legacy_browser': PackageInfo( |
| 52 LEGACY_BROWSER_PACKAGE, |
| 53 LEGACY_BROWSER_ACTIVITY, |
| 54 None, |
| 55 None, |
| 56 None), |
| 57 'content_shell': PackageInfo( |
| 58 CONTENT_SHELL_PACKAGE, |
| 59 CONTENT_SHELL_ACTIVITY, |
| 60 '/data/local/tmp/content-shell-command-line', |
| 61 None, |
| 62 None), |
| 63 'chromium_test_shell': PackageInfo( |
| 64 CHROMIUM_TEST_SHELL_PACKAGE, |
| 65 CHROMIUM_TEST_SHELL_ACTIVITY, |
| 66 '/data/local/tmp/chromium-testshell-command-line', |
| 67 CHROMIUM_TEST_SHELL_DEVTOOLS_SOCKET, |
| 68 'org.chromium.chrome.testshell.tests'), |
| 69 'gtest': PackageInfo( |
| 70 'org.chromium.native_test', |
| 71 'org.chromium.native_test.ChromeNativeTestActivity', |
| 72 '/data/local/tmp/chrome-native-tests-command-line', |
| 73 None, |
| 74 None), |
| 75 'content_browsertests': PackageInfo( |
| 76 'org.chromium.content_browsertests_apk', |
| 77 'org.chromium.content_browsertests_apk.ContentBrowserTestsActivity', |
| 78 '/data/local/tmp/content-browser-tests-command-line', |
| 79 None, |
| 80 None), |
| 81 } |
| 82 |
49 | 83 |
50 # Ports arrangement for various test servers used in Chrome for Android. | 84 # Ports arrangement for various test servers used in Chrome for Android. |
51 # Lighttpd server will attempt to use 9000 as default port, if unavailable it | 85 # Lighttpd server will attempt to use 9000 as default port, if unavailable it |
52 # will find a free port from 8001 - 8999. | 86 # will find a free port from 8001 - 8999. |
53 LIGHTTPD_DEFAULT_PORT = 9000 | 87 LIGHTTPD_DEFAULT_PORT = 9000 |
54 LIGHTTPD_RANDOM_PORT_FIRST = 8001 | 88 LIGHTTPD_RANDOM_PORT_FIRST = 8001 |
55 LIGHTTPD_RANDOM_PORT_LAST = 8999 | 89 LIGHTTPD_RANDOM_PORT_LAST = 8999 |
56 TEST_SYNC_SERVER_PORT = 9031 | 90 TEST_SYNC_SERVER_PORT = 9031 |
57 TEST_SEARCH_BY_IMAGE_SERVER_PORT = 9041 | 91 TEST_SEARCH_BY_IMAGE_SERVER_PORT = 9041 |
58 | 92 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 except OSError: | 143 except OSError: |
110 print >> sys.stderr, 'No adb found in $PATH, fallback to checked in binary.' | 144 print >> sys.stderr, 'No adb found in $PATH, fallback to checked in binary.' |
111 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 145 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
112 | 146 |
113 | 147 |
114 ADB_PATH = _GetADBPath() | 148 ADB_PATH = _GetADBPath() |
115 | 149 |
116 # Exit codes | 150 # Exit codes |
117 ERROR_EXIT_CODE = 1 | 151 ERROR_EXIT_CODE = 1 |
118 WARNING_EXIT_CODE = 88 | 152 WARNING_EXIT_CODE = 88 |
OLD | NEW |