1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-06 03:50:04 +02:00

Replace device:support:quit with util:lifecycle, which is usable by non-device processes too.

This commit is contained in:
Simo Kinnunen 2014-04-01 21:41:58 +09:00
parent e17f306d30
commit d6604bcda8
11 changed files with 75 additions and 179 deletions

View file

@ -3,29 +3,21 @@ var syrup = require('syrup')
var logger = require('../../../util/logger')
var wire = require('../../../wire')
var wireutil = require('../../../wire/util')
var lifecycle = require('../../../util/lifecycle')
module.exports = syrup.serial()
.dependency(require('../support/adb'))
.dependency(require('../support/router'))
.dependency(require('../support/push'))
.dependency(require('../support/quit'))
.dependency(require('./owner'))
.define(function(options, adb, router, push, quit, owner) {
.define(function(options, adb, router, push, owner) {
var log = logger.createLogger('device:plugins:logcat')
function openService() {
log.info('Launching logcat service')
return adb.openLogcat(options.serial)
.then(function(logcat) {
return logcat
.on('error', function(err) {
log.fatal('Logcat had an error', err)
quit.fatal()
})
.on('end', function() {
log.fatal('Logcat ended')
quit.fatal()
})
return lifecycle.share('Logcat', logcat)
})
}