Chromium Code Reviews| Index: content/simple_content_shell_test.sh |
| diff --git a/content/simple_content_shell_test.sh b/content/simple_content_shell_test.sh |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..13c234985787ffb34a54d6006a87968d54e715cd |
| --- /dev/null |
| +++ b/content/simple_content_shell_test.sh |
| @@ -0,0 +1,47 @@ |
| +#!/bin/bash |
|
jam
2012/07/13 15:11:29
nit: put this in content/shell/android?
|
| + |
| +# 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'). |
| +# The script expects your environment to be set up for chrome on android. |
| + |
| +if [ $# -ne 1 ]; then |
| + echo "Error: Please specify content shell location" |
| + exit 1 |
| +fi |
| + |
| +CONTENT_SHELL_APK=$1 |
| + |
| +# Reinstall content shell. This will also kill existing content_shell procs. |
| +adb uninstall org.chromium.content_shell |
| + |
| +if [ ! -f ${CONTENT_SHELL_APK} ]; then |
|
John Grabowski
2012/07/12 18:40:14
If no args are passed to this script, [ ! -f ${CON
navabi
2012/07/13 20:05:38
Done.
|
| + echo "Error: Could not find specified content shell apk to install." |
| + exit 1 |
| +fi |
| +adb install -r ${CONTENT_SHELL_APK} |
| + |
| +# Launch a content shell process to open about:version |
| +adb 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 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 uninstall org.chromium.content_shell |
| + exit -1 |
| +fi |
| + |
| +# Uninstall content shell to clean up. |
| +adb uninstall org.chromium.content_shell |