constants.py revision 2a99a7e74a7f215066514fe81d2bfa6639d9eddd
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
3# found in the LICENSE file.
4
5"""Defines a set of constants shared by test runners and other scripts."""
6
7import os
8
9
10CHROME_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__),
11                                          os.pardir, os.pardir, os.pardir))
12
13CHROME_PACKAGE = 'com.google.android.apps.chrome'
14CHROME_ACTIVITY = 'com.google.android.apps.chrome.Main'
15CHROME_DEVTOOLS_SOCKET = 'chrome_devtools_remote'
16
17CHROME_TESTS_PACKAGE = 'com.google.android.apps.chrome.tests'
18
19LEGACY_BROWSER_PACKAGE = 'com.google.android.browser'
20LEGACY_BROWSER_ACTIVITY = 'com.android.browser.BrowserActivity'
21
22CONTENT_SHELL_PACKAGE = 'org.chromium.content_shell_apk'
23CONTENT_SHELL_ACTIVITY = 'org.chromium.content_shell_apk.ContentShellActivity'
24
25CHROME_SHELL_PACKAGE = 'org.chromium.chrome.browser.test'
26
27CHROMIUM_TEST_SHELL_PACKAGE = 'org.chromium.chrome.testshell'
28CHROMIUM_TEST_SHELL_ACTIVITY = (
29    'org.chromium.chrome.testshell.ChromiumTestShellActivity')
30CHROMIUM_TEST_SHELL_DEVTOOLS_SOCKET = 'chromium_testshell_devtools_remote'
31CHROMIUM_TEST_SHELL_HOST_DRIVEN_DIR = os.path.join(
32    CHROME_DIR, 'chrome', 'android')
33
34GTEST_TEST_PACKAGE_NAME = 'org.chromium.native_test'
35GTEST_TEST_ACTIVITY_NAME = 'org.chromium.native_test.ChromeNativeTestActivity'
36GTEST_COMMAND_LINE_FILE = 'chrome-native-tests-command-line'
37
38BROWSERTEST_SUITE_NAME = 'content_browsertests'
39BROWSERTEST_TEST_PACKAGE_NAME = 'org.chromium.content_browsertests_apk'
40BROWSERTEST_TEST_ACTIVITY_NAME = (
41    'org.chromium.content_browsertests_apk.ContentBrowserTestsActivity')
42BROWSERTEST_COMMAND_LINE_FILE = 'content-browser-tests-command-line'
43
44# Ports arrangement for various test servers used in Chrome for Android.
45# Lighttpd server will attempt to use 9000 as default port, if unavailable it
46# will find a free port from 8001 - 8999.
47LIGHTTPD_DEFAULT_PORT = 9000
48LIGHTTPD_RANDOM_PORT_FIRST = 8001
49LIGHTTPD_RANDOM_PORT_LAST = 8999
50TEST_SYNC_SERVER_PORT = 9031
51
52# The net test server is started from 10000. Reserve 20000 ports for the all
53# test-server based tests should be enough for allocating different port for
54# individual test-server based test.
55TEST_SERVER_PORT_FIRST = 10000
56TEST_SERVER_PORT_LAST = 30000
57# A file to record next valid port of test server.
58TEST_SERVER_PORT_FILE = '/tmp/test_server_port'
59TEST_SERVER_PORT_LOCKFILE = '/tmp/test_server_port.lock'
60
61TEST_EXECUTABLE_DIR = '/data/local/tmp'
62# Directories for common java libraries for SDK build.
63# These constants are defined in build/android/ant/common.xml
64SDK_BUILD_TEST_JAVALIB_DIR = 'test.lib.java'
65SDK_BUILD_APKS_DIR = 'apks'
66
67# The directory on the device where perf test output gets saved to.
68DEVICE_PERF_OUTPUT_DIR = '/data/data/' + CHROME_PACKAGE + '/files'
69
70SCREENSHOTS_DIR = os.path.join(CHROME_DIR, 'out_screenshots')
71
72ANDROID_SDK_VERSION = 17
73ANDROID_SDK_ROOT = os.path.join(CHROME_DIR, 'third_party/android_tools/sdk')
74ANDROID_NDK_ROOT = os.path.join(CHROME_DIR, 'third_party/android_tools/ndk')
75
76UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com'
77