mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-25 02:05:15 +02:00
Add upload and installation errors.
This commit is contained in:
4
res/app/components/stf/install/index.js
Normal file
4
res/app/components/stf/install/index.js
Normal file
@@ -0,0 +1,4 @@
|
||||
module.exports = angular.module('stf.install-service', [
|
||||
require('gettext').name
|
||||
])
|
||||
.filter('installError', require('./install-error-filter'))
|
||||
12
res/app/components/stf/install/install-error-filter.js
Normal file
12
res/app/components/stf/install/install-error-filter.js
Normal file
@@ -0,0 +1,12 @@
|
||||
// From here: https://github.com/android/platform_frameworks_base/blob/
|
||||
// master/core/java/android/content/pm/PackageManager.java#L371
|
||||
|
||||
module.exports = function installErrorFilter(gettext) {
|
||||
return function (text) {
|
||||
return {
|
||||
INSTALL_FAILED_OLDER_SDK: gettext('New package failed because the ' +
|
||||
'current SDK version is older than that required by the package')
|
||||
// TODO: do the rest
|
||||
}[text] || text
|
||||
}
|
||||
}
|
||||
13
res/app/components/stf/install/install-spec.js
Normal file
13
res/app/components/stf/install/install-spec.js
Normal file
@@ -0,0 +1,13 @@
|
||||
describe('install', function() {
|
||||
|
||||
beforeEach(angular.mock.module(require('./').name))
|
||||
|
||||
it('should ...', inject(function($filter) {
|
||||
|
||||
var filter = $filter('install')
|
||||
|
||||
expect(filter('input')).toEqual('output')
|
||||
|
||||
}))
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user