File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 11const _ = require ( 'lodash' ) ;
22const exec = require ( 'shell-utils' ) . exec ;
33
4- const version = process . argv . splice ( process . execArgv . length + 2 ) [ 0 ] ;
4+ let version = process . argv . splice ( process . execArgv . length + 2 ) [ 0 ] ;
55const scriptDir = __dirname ;
66const distDir = `${ scriptDir } /../../dist` ;
77
88run ( ) ;
99
1010function run ( ) {
1111 if ( ! version ) {
12- throw new Error ( `usage: npm run downloadPublishedVersion 224109` )
12+ version = require ( '../../package.json' ) . version ;
1313 }
1414 const url = exec . execSyncRead ( `npm view jsc-android@${ version } dist.tarball` ) ;
1515 exec . execSync ( `curl ${ url } | tar -xf -` ) ;
Original file line number Diff line number Diff line change @@ -37,16 +37,20 @@ function run() {
3737 launchProfiler ( ) ;
3838 clickOnJsTest ( ) ;
3939 killProfiler ( ) ;
40+ resultsStr += readLogcatFilteredOutput ( ) + '\n' ;
41+ clearLogcat ( ) ;
4042
4143 launchProfiler ( ) ;
4244 clickOnFlatRenderTest ( ) ;
4345 killProfiler ( ) ;
46+ resultsStr += readLogcatFilteredOutput ( ) + '\n' ;
47+ clearLogcat ( ) ;
4448
4549 launchProfiler ( ) ;
4650 clickOnDeepRenderTest ( ) ;
4751 killProfiler ( ) ;
48-
4952 resultsStr += readLogcatFilteredOutput ( ) + '\n' ;
53+ clearLogcat ( ) ;
5054 } )
5155
5256 const resultLines = _ . split ( resultsStr , '\n' ) ;
@@ -92,14 +96,14 @@ function waitForLogcatMsg(msg) {
9296
9397function launchProfiler ( ) {
9498 console . log ( `launching...` ) ;
95- exec . execSyncSilent ( `adb shell am start-activity -W "${ PACKAGE_NAME } /.${ ACTIVITY_NAME } " && sleep 2` ) ;
99+ exec . execSyncSilent ( `adb shell am start-activity -W "${ PACKAGE_NAME } /.${ ACTIVITY_NAME } "` ) ;
100+ waitForLogcatMsg ( `${ LOGCAT_TAG } :ApplicationLoadedAndRendered` ) ;
96101}
97102
98103function killProfiler ( ) {
99104 console . log ( `killing` ) ;
100105 exec . execSyncSilent ( `adb shell am force-stop ${ PACKAGE_NAME } ` ) ;
101106 exec . execSyncSilent ( `adb shell am kill ${ PACKAGE_NAME } ` ) ;
102- exec . execSyncSilent ( `sleep 2` ) ;
103107}
104108
105109function clickOnJsTest ( ) {
You can’t perform that action at this time.
0 commit comments