💄 Avoid duplicate temporary file names.
This commit is contained in:
parent
b1f30c1eb6
commit
efd2bbbede
3 changed files with 5 additions and 3 deletions
|
@ -14,7 +14,7 @@ describe 'window module', ->
|
||||||
if (!isLoading)
|
if (!isLoading)
|
||||||
w.close()
|
w.close()
|
||||||
w.on 'destroyed', ->
|
w.on 'destroyed', ->
|
||||||
test = path.join(fixtures, 'api', 'test')
|
test = path.join(fixtures, 'api', 'unload')
|
||||||
content = fs.readFileSync(test)
|
content = fs.readFileSync(test)
|
||||||
fs.unlinkSync(test)
|
fs.unlinkSync(test)
|
||||||
assert.equal String(content), 'unload'
|
assert.equal String(content), 'unload'
|
||||||
|
@ -41,8 +41,10 @@ describe 'window module', ->
|
||||||
assert.equal isLoading, true
|
assert.equal isLoading, true
|
||||||
else if count == 1
|
else if count == 1
|
||||||
assert.equal isLoading, false
|
assert.equal isLoading, false
|
||||||
|
w.close()
|
||||||
done()
|
done()
|
||||||
else
|
else
|
||||||
|
w.close()
|
||||||
assert false
|
assert false
|
||||||
|
|
||||||
++count
|
++count
|
||||||
|
|
2
spec/fixtures/api/close.html
vendored
2
spec/fixtures/api/close.html
vendored
|
@ -2,7 +2,7 @@
|
||||||
<body>
|
<body>
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
window.addEventListener('unload', function (e) {
|
window.addEventListener('unload', function (e) {
|
||||||
require('fs').writeFileSync(__dirname + '/test', 'close');
|
require('fs').writeFileSync(__dirname + '/close', 'close');
|
||||||
}, false);
|
}, false);
|
||||||
window.close();
|
window.close();
|
||||||
</script>
|
</script>
|
||||||
|
|
2
spec/fixtures/api/unload.html
vendored
2
spec/fixtures/api/unload.html
vendored
|
@ -2,7 +2,7 @@
|
||||||
<body>
|
<body>
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
window.addEventListener('unload', function (e) {
|
window.addEventListener('unload', function (e) {
|
||||||
require('fs').writeFileSync(__dirname + '/test', 'unload');
|
require('fs').writeFileSync(__dirname + '/unload', 'unload');
|
||||||
}, false);
|
}, false);
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue