Fix refreshing test window

This commit is contained in:
Cheng Zhao 2015-06-05 19:48:58 +08:00
parent cd7b3dd291
commit 13c1b078f9
2 changed files with 6 additions and 1 deletions

View file

@ -39,8 +39,12 @@ describe 'crash-reporter module', ->
res.end('abc-123-def')
server.close()
done()
server.listen 0, '127.0.0.1', ->
# Server port is generated randomly for the first run, it will be reused
# when page is refreshed.
port = remote.process.port
server.listen port, '127.0.0.1', ->
{port} = server.address()
remote.process.port = port
url = url.format
protocol: 'file'
pathname: path.join fixtures, 'api', 'crash.html'