Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/bin/bash | |
|
jam
2012/07/13 15:11:29
nit: put this in content/shell/android?
| |
| 2 | |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 4 # Use of this source code is governed by a BSD-style license that can be | |
| 5 # found in the LICENSE file. | |
| 6 | |
| 7 # Simple test launches a content shell to load a URL, and waits 5 seconds before | |
| 8 # checking there are two content shell processes (grep ps for 'content_shell'). | |
| 9 # The script expects your environment to be set up for chrome on android. | |
| 10 | |
| 11 if [ $# -ne 1 ]; then | |
| 12 echo "Error: Please specify content shell location" | |
| 13 exit 1 | |
| 14 fi | |
| 15 | |
| 16 CONTENT_SHELL_APK=$1 | |
| 17 | |
| 18 # Reinstall content shell. This will also kill existing content_shell procs. | |
| 19 adb uninstall org.chromium.content_shell | |
| 20 | |
| 21 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.
| |
| 22 echo "Error: Could not find specified content shell apk to install." | |
| 23 exit 1 | |
| 24 fi | |
| 25 adb install -r ${CONTENT_SHELL_APK} | |
| 26 | |
| 27 # Launch a content shell process to open about:version | |
| 28 adb shell am start -n org.chromium.content_shell/.ContentShellActivity -d \ | |
| 29 "about:version" | |
| 30 | |
| 31 # Wait 5 seconds, to give the content shell some time to crash. | |
| 32 sleep 5 | |
| 33 | |
| 34 # Get the number of content shell procs that exist. | |
| 35 NUM_PROCS=`adb shell ps | grep content_shell | wc | awk '{print $1}'` | |
| 36 | |
| 37 # Check that there are two content shell processes (browser and renderer). | |
| 38 if [[ "${NUM_PROCS}" -lt 2 ]]; then | |
| 39 echo "ERROR: Expected two content shell processes (browser and renderer)." | |
| 40 echo " Found ${NUM_PROCS} 'content_shell' process(es)." | |
| 41 # Uninstall content shell to clean up. | |
| 42 adb uninstall org.chromium.content_shell | |
| 43 exit -1 | |
| 44 fi | |
| 45 | |
| 46 # Uninstall content shell to clean up. | |
| 47 adb uninstall org.chromium.content_shell | |
| OLD | NEW |