1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00

Update to new version of STFService. Also, there's actually no need to stop the service before starting it, because it will be done for us on reinstall.

This commit is contained in:
Simo Kinnunen 2014-05-12 15:35:08 +09:00
parent 111db01500
commit 02003da91f
3 changed files with 7 additions and 16 deletions

View file

@ -89,8 +89,8 @@ module.exports = syrup.serial()
return devutil.killProcsByComm(
adb
, options.serial
, 'app_process'
, 'app_process'
, 'stf.agent'
, 'stf.agent'
)
}
@ -143,17 +143,12 @@ module.exports = syrup.serial()
})
}
// The APK should be up to date at this point. If it was reinstalled, the
// service should have been automatically stopped while it was happening.
// So, we should be good to go.
function openService() {
log.info('Launching service')
return stopService()
.timeout(15000)
.then(function() {
return devutil.waitForPortToFree(adb, options.serial, service.port)
.timeout(10000)
})
.then(function() {
return callService(util.format("-a '%s'", apk.startAction))
})
return callService(util.format("-a '%s'", apk.startAction))
.then(function() {
return devutil.waitForPort(adb, options.serial, service.port)
.timeout(15000)
@ -250,10 +245,6 @@ module.exports = syrup.serial()
}
}
function stopService() {
return callService(util.format("-a '%s'", apk.stopAction))
}
function keyEvent(data) {
return runAgentCommand(
apk.wire.MessageType.DO_KEYEVENT