Commit ec820d31 authored by bulach@chromium.org's avatar bulach@chromium.org

Android: replace temporary test runner with the instrumentation runner.

Follow up from http://codereview.chromium.org/10826071/

BUG=139365
TEST=Android FYI tester runs instrumentation tests.


Review URL: https://chromiumcodereview.appspot.com/10828094

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149679 0039d316-1c4b-4281-b951-d872f2087c98
parent 296ce7ce
...@@ -254,13 +254,6 @@ function bb_run_tests { ...@@ -254,13 +254,6 @@ function bb_run_tests {
build/android/run_tests.py --xvfb --verbose build/android/run_tests.py --xvfb --verbose
} }
# Run simple content shell test on device.
function bb_run_content_shell_test {
echo "@@@BUILD_STEP Run simple content shell test on actual hardware@@@"
content/shell/android/simple_content_shell_test.sh \
"${SRC_ROOT}"/out/Release/content_shell/ContentShell-debug.apk
}
# Run instrumentation test. # Run instrumentation test.
# Args: # Args:
# $1: TEST_APK. # $1: TEST_APK.
...@@ -282,8 +275,9 @@ function bb_run_content_shell_instrumentation_test { ...@@ -282,8 +275,9 @@ function bb_run_content_shell_instrumentation_test {
build/android/adb_install_content_shell build/android/adb_install_content_shell
local TEST_APK="content_shell_test/ContentShellTest-debug" local TEST_APK="content_shell_test/ContentShellTest-debug"
# Use -I to install the test apk only on the first run. # Use -I to install the test apk only on the first run.
# TODO(bulach): remove the second once we have a Smoke test.
bb_run_instrumentation_test ${TEST_APK} "-I -A Smoke" bb_run_instrumentation_test ${TEST_APK} "-I -A Smoke"
bb_run_instrumentation_test ${TEST_APK} "-A SmallTest" bb_run_instrumentation_test ${TEST_APK} "-I -A SmallTest"
bb_run_instrumentation_test ${TEST_APK} "-A MediumTest" bb_run_instrumentation_test ${TEST_APK} "-A MediumTest"
bb_run_instrumentation_test ${TEST_APK} "-A LargeTest" bb_run_instrumentation_test ${TEST_APK} "-A LargeTest"
} }
......
#!/bin/bash -ex
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Buildbot annotator script for the FYI waterfall. Compile,
# experimental compile, run tests, ...
# SHERIFF: there should be no need to disable this bot.
# The FYI waterfall does not close the tree.
BB_SRC_ROOT="$(cd "$(dirname $0)/../.."; pwd)"
. "${BB_SRC_ROOT}/build/android/buildbot_functions.sh"
bb_baseline_setup "$BB_SRC_ROOT" "$@"
bb_install_build_deps "$BB_SRC_ROOT"
bb_compile
bb_compile_experimental
bb_run_tests
bb_run_content_shell_test
...@@ -16,5 +16,4 @@ bb_baseline_setup "$BB_SRC_ROOT" "$@" ...@@ -16,5 +16,4 @@ bb_baseline_setup "$BB_SRC_ROOT" "$@"
bb_install_build_deps "$BB_SRC_ROOT" bb_install_build_deps "$BB_SRC_ROOT"
bb_extract_build bb_extract_build
bb_run_tests bb_run_tests
bb_run_content_shell_test
bb_run_content_shell_instrumentation_test bb_run_content_shell_instrumentation_test
...@@ -16,4 +16,4 @@ bb_baseline_setup "${ROOT}"/../.. ...@@ -16,4 +16,4 @@ bb_baseline_setup "${ROOT}"/../..
bb_install_build_deps "${ROOT}"/../.. bb_install_build_deps "${ROOT}"/../..
bb_compile bb_compile
bb_run_tests bb_run_tests
bb_run_content_shell_test bb_run_content_shell_instrumentation_test
...@@ -16,4 +16,4 @@ bb_baseline_setup "$BB_SRC_ROOT" "$@" ...@@ -16,4 +16,4 @@ bb_baseline_setup "$BB_SRC_ROOT" "$@"
bb_install_build_deps "$BB_SRC_ROOT" bb_install_build_deps "$BB_SRC_ROOT"
bb_extract_build bb_extract_build
bb_run_tests bb_run_tests
bb_run_content_shell_test bb_run_content_shell_instrumentation_test
#!/bin/bash
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Simple test launches a content shell to load a URL, and waits 5 seconds before
# checking there are two content shell processes (grep ps for 'content_shell').
# If multiple devices are connected, the test runs on the first one listed by
# adb devices. The script expects your environment to already be set up.
if [ $# -ne 1 ]; then
echo "Error: Please specify content shell location"
exit 1
fi
CONTENT_SHELL_APK=$1
DEV=$(adb devices | grep device | grep -v devices | awk '{ print $1 }' \
| head -n 1)
if [[ -z $DEV ]]; then
echo "Error: No connected devices. Device needed to run content shell test."
exit 1
fi
# Reinstall content shell. This will also kill existing content_shell procs.
adb -s ${DEV} uninstall org.chromium.content_shell
if [ ! -f "${CONTENT_SHELL_APK}" ]; then
echo "Error: Could not find specified content shell apk to install."
exit 1
fi
adb -s ${DEV} install -r ${CONTENT_SHELL_APK}
# Launch a content shell process to open about:version
adb -s ${DEV} shell am start -n \
org.chromium.content_shell/.ContentShellActivity -d "about:version"
# Wait 5 seconds, to give the content shell some time to crash.
sleep 5
# Get the number of content shell procs that exist.
NUM_PROCS=$(adb -s ${DEV} shell ps | grep content_shell | wc | awk '{print $1}')
# Check that there are two content shell processes (browser and renderer).
if [[ "${NUM_PROCS}" -lt 2 ]]; then
echo "ERROR: Expected two content shell processes (browser and renderer)."
echo " Found ${NUM_PROCS} 'content_shell' process(es)."
# Uninstall content shell to clean up.
adb -s ${DEV} uninstall org.chromium.content_shell
exit 1
fi
# Uninstall content shell to clean up.
adb -s ${DEV} uninstall org.chromium.content_shell
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment