Created
February 22, 2019 22:32
-
-
Save bdekoz/3d72f611a84bcd0c941134f44c8480a8 to your computer and use it in GitHub Desktop.
browsertime hacks #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Invoke like `env ANDROID_SERIAL=... bash one.sh -n 3 -vv https://google.com`. | |
: PACKAGE ${PACKAGE:=org.mozilla.tv.firefox.gecko.debug} | |
+ : PACKAGE org.mozilla.tv.firefox.gecko.debug | |
# : EXTERNAL ${EXTERNAL:=/mnt/sdcard} | |
: TMP ${TMP:=/tmp} | |
+ : TMP /tmp | |
: RESULT_TOP_DIR ${RESULT_TOP_DIR:=browsertime-results} | |
+ : RESULT_TOP_DIR browsertime-results | |
: ANDROID_SERIAL ${ANDROID_SERIAL:='172.31.200.28:5555'} | |
+ : ANDROID_SERIAL 172.31.200.28:5555 | |
export ANDROID_SERIAL | |
+ export ANDROID_SERIAL | |
: TURBO ${TURBO:=true false} | |
+ : TURBO true false | |
: BROWSER ${BROWSER:=firefox chrome} | |
+ : BROWSER chrome | |
URL=${@: -1} | |
+ URL=-vv | |
URL=${URL#"https://"} | |
+ URL=-vv | |
# N.B.: yargs doesn't parse `--firefox.android.intentArgument --ez` | |
# properly, so always use `=--ez`! | |
if [[ $BROWSER == *"firefox"* ]] ; then | |
for turbo in $TURBO ; do | |
env RUST_BACKTRACE=1 RUST_LOG=trace bin/browsertime.js \ | |
--android \ | |
--skipHar \ | |
--firefox.geckodriverPath "/home/bkoz/src/mozilla-gecko.target.git/target/debug/geckodriver" \ | |
--firefox.android.deviceSerial="$ANDROID_SERIAL" \ | |
--firefox.android.package "org.mozilla.tv.firefox.gecko.debug" \ | |
--firefox.android.activity "org.mozilla.tv.firefox.MainActivity" \ | |
--firefox.android.intentArgument=--ez \ | |
--firefox.android.intentArgument=TURBO_MODE \ | |
--firefox.android.intentArgument=$turbo \ | |
--firefox.android.intentArgument=-a \ | |
--firefox.android.intentArgument=android.intent.action.VIEW \ | |
--firefox.android.intentArgument=-d \ | |
--firefox.android.intentArgument="data:," \ | |
--browser firefox \ | |
--resultDir "$RESULT_TOP_DIR/firefox.turbo-$turbo/$URL" \ | |
"$@" | |
done | |
fi | |
+ [[ chrome == *\f\i\r\e\f\o\x* ]] | |
# N.B.: chromedriver doesn't have an official way to pass intent | |
# arguments, but it does have an unsanitized injection at | |
# https://github.com/bayandin/chromedriver/blob/5a2b8f793391c80c9d1a1b0004f28be0a2be9ab2/chrome/adb_impl.cc#L212. | |
if [[ $BROWSER == *"chrome"* ]] ; then | |
for turbo in $TURBO ; do | |
bin/browsertime.js \ | |
--android \ | |
--skipHar \ | |
--chrome.chromedriverPath "/home/bkoz/src/chromedriver" \ | |
--chrome.android.deviceSerial="$ANDROID_SERIAL" \ | |
--chrome.android.package "org.mozilla.tv.firefox.debug" \ | |
--chrome.android.activity="org.mozilla.tv.firefox.MainActivity --ez TURBO_MODE false -a android.intent.action.VIEW" \ | |
--browser chrome \ | |
--resultDir "$RESULT_TOP_DIR/chrome.turbo-$turbo/$URL" \ | |
"$@" | |
done | |
fi | |
+ [[ chrome == *\c\h\r\o\m\e* ]] | |
+ for turbo in $TURBO | |
+ bin/browsertime.js --android --skipHar --chrome.chromedriverPath /home/bkoz/src/chromedriver --chrome.android.deviceSerial=172.31.200.28:5555 --chrome.android.package org.mozilla.tv.firefox.debug '--chrome.android.activity=org.mozilla.tv.firefox.MainActivity --ez TURBO_MODE false -a android.intent.action.VIEW' --browser chrome --resultDir browsertime-results/chrome.turbo-true/-vv --preURL https://google.com --preURLDelay 5000 https://twitter.com -n 1 -vv | |
[2019-02-22 14:32:05] DEBUG: [browsertime] Running with options: { | |
"scripts": [], | |
"iterations": 1, | |
"delay": 0, | |
"videoParams": { | |
"addTimer": true, | |
"debug": false, | |
"keepOriginalVideo": false, | |
"filmstripFullSize": false, | |
"createFilmstrip": true, | |
"framerate": 30, | |
"crf": 23, | |
"filmstripQuality": 75, | |
"nice": 0 | |
}, | |
"_": [ | |
"https://twitter.com" | |
], | |
"video-params": { | |
"add-timer": true, | |
"debug": false, | |
"keep-original-video": false, | |
"filmstrip-full-size": false, | |
"create-filmstrip": true, | |
"framerate": 30, | |
"crf": 23, | |
"filmstrip-quality": 75, | |
"nice": 0 | |
}, | |
"android": true, | |
"screenshot": false, | |
"pageCompleteCheckInactivity": false, | |
"page-complete-check-inactivity": false, | |
"prettyPrint": false, | |
"pretty-print": false, | |
"connectivity": { | |
"throttle": { | |
"localhost": false | |
}, | |
"profile": "native", | |
"engine": "external" | |
}, | |
"cacheClearRaw": false, | |
"cache-clear-raw": false, | |
"xvfb": false, | |
"headless": false, | |
"spa": false, | |
"skipHar": true, | |
"skip-har": true, | |
"chrome": { | |
"chromedriverPath": "/home/bkoz/src/chromedriver", | |
"chromedriver-path": "/home/bkoz/src/chromedriver", | |
"android": { | |
"deviceSerial": "172.31.200.28:5555", | |
"device-serial": "172.31.200.28:5555", | |
"package": "org.mozilla.tv.firefox.debug", | |
"activity": "org.mozilla.tv.firefox.MainActivity --ez TURBO_MODE false -a android.intent.action.VIEW" | |
} | |
}, | |
"browser": "chrome", | |
"b": "chrome", | |
"resultDir": "browsertime-results/chrome.turbo-true/-vv", | |
"result-dir": "browsertime-results/chrome.turbo-true/-vv", | |
"preURL": "https://google.com", | |
"pre-url": "https://google.com", | |
"preURLDelay": 5000, | |
"pre-url-delay": 5000, | |
"n": 1, | |
"v": 2, | |
"verbose": 2, | |
"timeouts": { | |
"browserStart": 60000, | |
"browser-start": 60000, | |
"pageLoad": 300000, | |
"page-load": 300000, | |
"script": 80000, | |
"pageCompleteCheck": 300000, | |
"page-complete-check": 300000 | |
}, | |
"firefox": { | |
"includeResponseBodies": "none", | |
"include-response-bodies": "none" | |
}, | |
"screenshotParams": { | |
"type": "jpg", | |
"png": { | |
"compressionLevel": 6 | |
}, | |
"jpg": { | |
"quality": 80 | |
}, | |
"maxSize": 2000 | |
}, | |
"screenshot-params": { | |
"type": "jpg", | |
"png": { | |
"compression-level": 6 | |
}, | |
"jpg": { | |
"quality": 80 | |
}, | |
"max-size": 2000 | |
}, | |
"pageCompleteWaitTime": 5000, | |
"page-complete-wait-time": 5000, | |
"c": "native", | |
"percentiles": [ | |
0, | |
10, | |
90, | |
99, | |
100 | |
], | |
"decimals": 0, | |
"xvfbParams": { | |
"display": 99 | |
}, | |
"xvfb-params": { | |
"display": 99 | |
}, | |
"silent": 0, | |
"q": 0, | |
"$0": "bin/browsertime.js" | |
} | |
[2019-02-22 14:32:05] INFO: [browsertime] Running tests using Chrome - 1 iteration(s) | |
events.js:167 | |
throw er; // Unhandled 'error' event | |
^ | |
Error: spawn /home/bkoz/src/chromedriver EACCES | |
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19) | |
at onErrorNT (internal/child_process.js:407:16) | |
at process._tickCallback (internal/process/next_tick.js:63:19) | |
Emitted 'error' event at: | |
at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12) | |
at onErrorNT (internal/child_process.js:407:16) | |
at process._tickCallback (internal/process/next_tick.js:63:19) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment