Browse Source

Add spec for valid .ico file

Kevin Sawicki 8 years ago
parent
commit
14df90fd19
2 changed files with 10 additions and 0 deletions
  1. 10 0
      spec/api-native-image-spec.js
  2. BIN
      spec/fixtures/assets/icon.ico

+ 10 - 0
spec/api-native-image-spec.js

@@ -48,5 +48,15 @@ describe('nativeImage module', () => {
       // If all bytes are null, that's Bad
       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