| # 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"' |
| EXAMPLE='"/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"' |
| if [ $# -ne 3 ] || ! [ -x "$1" ]; then |
| $0 CHROMIUM_BINARY SOURCE_URL DESTINATION_PATH |
| $0 $EXAMPLE https://www.google.com/ /tmp/foo.mskp |
| CRASH=~/tmp/headless_crash_dumps |
| printf 'chrome.gpuBenchmarking.printPagesToSkPictures("%s");\nquit\n' "$DST" | \ |
| "$EXE" --headless --disable-gpu --repl -crash-dumps-dir="$CRASH" \ |
| --no-sandbox --enable-gpu-benchmarking "$URL" |