diff options
Diffstat (limited to 'experimental/tools/web_to_mskp')
-rwxr-xr-x | experimental/tools/web_to_mskp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/experimental/tools/web_to_mskp b/experimental/tools/web_to_mskp new file mode 100755 index 0000000000..c2df8a30cc --- /dev/null +++ b/experimental/tools/web_to_mskp @@ -0,0 +1,34 @@ +#! /bin/sh + +# Copyright 2018 Google Inc. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +if [ "$(uname)" = Linux ]; then + EXAMPLE='/opt/google/chrome/chrome' +elif [ "$(uname)" = Darwin ]; then + EXAMPLE='"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"' +else + EXAMPLE='"/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"' +fi + +if [ $# -ne 3 ] || ! [ -x "$1" ]; then + cat >&2 << EOF +usage: + $0 CHROMIUM_BINARY SOURCE_URL DESTINATION_PATH +e.g: + $0 $EXAMPLE https://www.google.com/ /tmp/foo.mskp +EOF + exit 1 +fi + +EXE="$1" +URL="$2" +DST="$3" + +CRASH=~/tmp/headless_crash_dumps +mkdir -p "$CRASH" + +printf 'chrome.gpuBenchmarking.printPagesToSkPictures("%s");\nquit\n' "$DST" | \ + "$EXE" --headless --disable-gpu --repl -crash-dumps-dir="$CRASH" \ + --no-sandbox --enable-gpu-benchmarking "$URL" |