Add build/android scripts for Chromium TestShell

This is to match existing scripts for Content Shell.

There seem to be inconsistency in usages of 'testshell' vs. 'test_shell'. Since the build target is called 'chromium_testshell', and the package is called 'org.chromium.chrome.testshell', I'm leaning towards using this spelling.

R=digit@chromium.org

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

git-svn-id: http://src.chromium.org/svn/trunk/src/build@164808 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
mnaganov@chromium.org 2012-10-30 01:07:38 +00:00
Родитель 5b365a4c4d
Коммит 1d42dec2d7
3 изменённых файлов: 51 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,37 @@
#!/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.
# If no flags are given, prints the current chromium test shell flags.
#
# Otherwise, the given flags are used to REPLACE (not modify) the chromium
# test shell flags. For example:
# adb_chromium_testshell_command_line --enable-webgl
#
# To remove all chromium test shell flags, pass an empty string for the flags:
# adb_chromium_testshell_command_line ""
CMD_LINE_FILE=/data/local/tmp/chromium-testshell-command-line
if [ $# -eq 0 ] ; then
# If nothing specified, print the command line (stripping off "chromium_testshell")
tempfile=$(tempfile)
adb pull $CMD_LINE_FILE $tempfile 2>/dev/null
if [ $? -eq 0 ] ; then
rm $tempfile
adb shell cat $CMD_LINE_FILE | cut -d " " -f "2-" 2>/dev/null
fi
elif [ $# -eq 1 ] && [ "$1" = '' ] ; then
# If given an empty string, delete the command line.
set -x
adb shell rm $CMD_LINE_FILE >/dev/null
else
# Else set it.
set -x
adb shell "echo 'chromium_testshell $*' > $CMD_LINE_FILE"
# Prevent other apps from modifying flags -- this can create security issues.
adb shell chmod 0664 $CMD_LINE_FILE
fi

Просмотреть файл

Просмотреть файл

@ -0,0 +1,14 @@
#!/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.
if [ $# -gt 0 ] ; then
INTENT_ARGS='-d "$1"' # e.g. a URL
fi
adb shell am start \
-a android.intent.action.VIEW \
-n org.chromium.chrome.testshell/.ChromiumTestShellActivity \
$INTENT_ARGS