summaryrefslogtreecommitdiff
path: root/chromium/tools/WebViewShell/run_startup_time_test.sh
diff options
context:
space:
mode:
authorBo Liu <boliu@google.com>2014-11-07 09:48:04 -0800
committerBo Liu <boliu@google.com>2014-11-07 10:11:06 -0800
commitf74ac76333a8ba74c86175db30a6ebaa5fd57375 (patch)
treeddf934c9764318cc792d1fd000aed146c2be78bb /chromium/tools/WebViewShell/run_startup_time_test.sh
parent7d62eab4ca242beacac4471c002e998ef5c218b8 (diff)
downloadwebview-f74ac76333a8ba74c86175db30a6ebaa5fd57375.tar.gz
Push m39 glue to chromium-dev
M39 sha1: 8a26cc6f7dd4d893790e7c4f13df901845ab045d This be built against android-5.0.0_r2 frameworks/base. Change-Id: I668b7279b706b7288de7b24cebdb20e2aad13912
Diffstat (limited to 'chromium/tools/WebViewShell/run_startup_time_test.sh')
-rw-r--r--chromium/tools/WebViewShell/run_startup_time_test.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/chromium/tools/WebViewShell/run_startup_time_test.sh b/chromium/tools/WebViewShell/run_startup_time_test.sh
new file mode 100644
index 0000000..7ddf83a
--- /dev/null
+++ b/chromium/tools/WebViewShell/run_startup_time_test.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+if ! which adb &> /dev/null; then
+ echo "adb is not in your path, did you run envsetup.sh?"
+ exit -1
+fi
+
+TMPFILE=$(tempfile)
+echo '<body><div>just some text</div></body>' > $TMPFILE
+adb push $TMPFILE /data/local/tmp/file.html
+rm $TMPFILE
+adb shell am start -n com.android.htmlviewer/.HTMLViewerActivity -d "file:///data/local/tmp/file.html" -a VIEW -t "text/html"
+
+sleep 3
+
+echo 'Running test, you should run `adb logcat | grep WebViewStartupTimeMillis=` in another shell to see results.'
+# Launch webview test shell 100 times
+for i in $(seq 1 100); do
+ if [[ $(($i % 10)) -eq 0 ]]; then
+ echo -n "..$i.."
+ fi
+ adb shell kill -9 `adb shell ps | grep com.android.webview.chromium.shell | tr -s " " " " | cut -d" " -f2`
+ adb shell am start -n com.android.webview.chromium.shell/.StartupTimeActivity -a VIEW > /dev/null
+ sleep 0.5
+done
+echo
+
+adb shell rm /data/local/tmp/file.html