Revert of [Android WebView] Synthesize a fake page loading event on page source modif...
[chromium-blink-merge.git] / build / android / adb_chrome_shell_command_line
blob1e2bd3820d3e4f485db572229870373c7ef6a59a
1 #!/bin/bash
3 # Copyright 2014 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.
7 # If no flags are given, prints the current chrome shell flags.
9 # Otherwise, the given flags are used to REPLACE (not modify) the chrome shell
10 # flags. For example:
11 # adb_chrome_shell_command_line --enable-webgl
13 # To remove all chrome shell flags, pass an empty string for the flags:
14 # adb_chrome_shell_command_line ""
16 CMD_LINE_FILE=/data/local/tmp/chrome-shell-command-line
18 if [ $# -eq 0 ] ; then
19 # If nothing specified, print the command line (stripping off "chrome_shell")
20 tempfile=$(tempfile)
21 adb pull $CMD_LINE_FILE $tempfile 2>/dev/null
22 if [ $? -eq 0 ] ; then
23 rm $tempfile
24 adb shell cat $CMD_LINE_FILE | cut -d " " -f "2-" 2>/dev/null
26 elif [ $# -eq 1 ] && [ "$1" = '' ] ; then
27 # If given an empty string, delete the command line.
28 set -x
29 adb shell rm $CMD_LINE_FILE >/dev/null
30 else
31 # Else set it.
32 set -x
33 adb shell "echo 'chrome_shell $*' > $CMD_LINE_FILE"
34 # Prevent other apps from modifying flags -- this can create security issues.
35 adb shell chmod 0664 $CMD_LINE_FILE