Add spec for valid .ico file
This commit is contained in:
parent
8fb86e10fc
commit
14df90fd19
2 changed files with 10 additions and 0 deletions
|
@ -48,5 +48,15 @@ describe('nativeImage module', () => {
|
||||||
// If all bytes are null, that's Bad
|
// If all bytes are null, that's Bad
|
||||||
assert.equal(nsimage.reduce((acc, x) => acc || (x !== 0), false), true)
|
assert.equal(nsimage.reduce((acc, x) => acc || (x !== 0), false), true)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('loads images from .ico files on Windows', () => {
|
||||||
|
if (process.platform !== 'win32') return
|
||||||
|
|
||||||
|
const imagePath = path.join(__dirname, 'fixtures', 'assets', 'icon.ico')
|
||||||
|
const image = nativeImage.createFromPath(imagePath)
|
||||||
|
assert(!image.isEmpty())
|
||||||
|
assert.equal(image.getSize().height, 256)
|
||||||
|
assert.equal(image.getSize().width, 256)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
BIN
spec/fixtures/assets/icon.ico
vendored
Normal file
BIN
spec/fixtures/assets/icon.ico
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 76 KiB |
Loading…
Reference in a new issue