mirror of
https://github.com/openstf/stf
synced 2025-10-04 02:09:32 +02:00
Keep better track of vital streams. Add monkey.
This commit is contained in:
parent
6c350d0068
commit
ae4e4d3075
3 changed files with 146 additions and 4 deletions
|
@ -40,6 +40,23 @@ devutil.ensureUnusedPort = function(adb, serial, port) {
|
|||
})
|
||||
}
|
||||
|
||||
devutil.waitForPort = function(adb, serial, port) {
|
||||
function closedError(err) {
|
||||
return err.message === 'closed'
|
||||
}
|
||||
return adb.openTcpAsync(serial, port)
|
||||
.then(function(conn) {
|
||||
conn.end()
|
||||
return port
|
||||
})
|
||||
.catch(closedError, function(err) {
|
||||
return Promise.delay(100)
|
||||
.then(function() {
|
||||
return devutil.waitForPort(adb, serial, port)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
devutil.killProcsByComm = function(adb, serial, comm, bin) {
|
||||
return adb.shellAsync(serial, ['ps', comm])
|
||||
.then(function(out) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue