]> khamidou — GitHub mirrors - electron.git/commitdiff
spec: Reading asar file should not leak fd
authorCheng Zhao <zcbenz@gmail.com>
Thu, 24 Sep 2015 04:15:18 +0000 (12:15 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 24 Sep 2015 04:15:18 +0000 (12:15 +0800)
spec/asar-spec.coffee

index 4ef9337f3abe87fa50c5ef5f3d2162dfb0114e4a..1e6ee69103694c084f5725d9f1ea0099d1ba87ff 100644 (file)
@@ -8,6 +8,10 @@ describe 'asar package', ->
 
   describe 'node api', ->
     describe 'fs.readFileSync', ->
+      it 'does not leak fd', ->
+        for i in [1..10000]
+          fs.readFileSync(path.join(process.resourcesPath, 'atom.asar', 'renderer', 'api', 'lib', 'ipc.js'))
+
       it 'reads a normal file', ->
         file1 = path.join fixtures, 'asar', 'a.asar', 'file1'
         assert.equal fs.readFileSync(file1).toString().trim(), 'file1'