feat: Implementation of getGPUInfo API. (#13486)

* Implementation of getGPUInfo API.

* Clear promise set

* Changes to promise usage

* Minor fixes

* Fix linux build

* Update spec

* Fix lint (linter didn't run on windows locally)

* Test running single test for CI

* Update spec
This commit is contained in:
Nitish Sakhawalkar 2018-09-27 07:59:23 -07:00 committed by Samuel Attard
parent 638311b6b3
commit 5c108728d6
13 changed files with 529 additions and 127 deletions

View file

@ -804,6 +804,37 @@ describe('app module', () => {
})
})
describe('getGPUInfo() API', () => {
it('succeeds with basic GPUInfo', (done) => {
app.getGPUInfo('basic').then((gpuInfo) => {
// Devices information is always present in the available info
expect(gpuInfo.gpuDevice).to.be.an('array')
expect(gpuInfo.gpuDevice.length).to.be.greaterThan(0)
const device = gpuInfo.gpuDevice[0]
expect(device).to.be.an('object')
expect(device)
.to.have.property('deviceId')
.that.is.a('number')
.not.lessThan(0)
done()
})
})
it('succeeds with complete GPUInfo', (done) => {
app.getGPUInfo('complete').then((completeInfo) => {
// Driver version is present in the complete info
expect(completeInfo.auxAttributes.glVersion).to.be.a('string').that.has.length.greaterThan(0)
done()
})
})
it('fails for invalid info_type', (done) => {
app.getGPUInfo('invalid').catch(() => {
done()
})
})
})
describe('mixed sandbox option', () => {
let appProcess = null
let server = null