]> khamidou — GitHub mirrors - electron.git/commitdiff
:lipstick: Avoid duplicate temporary file names.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 29 Aug 2013 10:03:14 +0000 (18:03 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 29 Aug 2013 10:03:14 +0000 (18:03 +0800)
spec/api/window.coffee
spec/fixtures/api/close.html
spec/fixtures/api/unload.html

index cd832e9618b00c04d540183c1f6128a67920ebfe..d4a4b79fea067b31b3eef9474e74d2f2d6db21ea 100644 (file)
@@ -14,7 +14,7 @@ describe 'window module', ->
         if (!isLoading)
           w.close()
       w.on 'destroyed', ->
-        test = path.join(fixtures, 'api', 'test')
+        test = path.join(fixtures, 'api', 'unload')
         content = fs.readFileSync(test)
         fs.unlinkSync(test)
         assert.equal String(content), 'unload'
@@ -41,8 +41,10 @@ describe 'window module', ->
           assert.equal isLoading, true
         else if count == 1
           assert.equal isLoading, false
+          w.close()
           done()
         else
+          w.close()
           assert false
 
         ++count
index 0b6e4f3613184c936177cc6234cb01a5b60fd761..24846f7228363443e051c2646d075a94cef98d7d 100644 (file)
@@ -2,7 +2,7 @@
 <body>
 <script type="text/javascript" charset="utf-8">
   window.addEventListener('unload', function (e) {
-    require('fs').writeFileSync(__dirname + '/test', 'close');
+    require('fs').writeFileSync(__dirname + '/close', 'close');
   }, false);
   window.close();
 </script>
index 9490c56d15666c0fe25bcf1fe05e8a0baa16a874..da749641f9d68f2892debb2bb237b363196cf058 100644 (file)
@@ -2,7 +2,7 @@
 <body>
 <script type="text/javascript" charset="utf-8">
   window.addEventListener('unload', function (e) {
-    require('fs').writeFileSync(__dirname + '/test', 'unload');
+    require('fs').writeFileSync(__dirname + '/unload', 'unload');
   }, false);
 </script>
 </body>