Update cookies spec.
This commit is contained in:
parent
bafbee805c
commit
db23d1165c
1 changed files with 13 additions and 11 deletions
|
@ -7,7 +7,7 @@ BrowserWindow = remote.require 'browser-window'
|
|||
describe 'cookies module', ->
|
||||
fixtures = path.resolve __dirname, 'fixtures'
|
||||
w = null
|
||||
url = "http://127.0.0.1:9999"
|
||||
url = "http://127.0.0.1"
|
||||
|
||||
beforeEach -> w = new BrowserWindow(show: true)
|
||||
afterEach -> w.destroy()
|
||||
|
@ -17,10 +17,12 @@ describe 'cookies module', ->
|
|||
console.log req
|
||||
res.setHeader('Set-Cookie', ['type=dummy'])
|
||||
res.end('finished')
|
||||
server.close()
|
||||
|
||||
server.listen 9999, '127.0.0.1', ->
|
||||
port = remote.process.port
|
||||
server.listen port, '127.0.0.1', ->
|
||||
{port} = server.address()
|
||||
w.loadUrl url
|
||||
w.loadUrl "#{url}:#{port}"
|
||||
w.webContents.on 'did-finish-load', ()->
|
||||
w.webContents.session.cookies.get {url: url}, (error, cookies) ->
|
||||
throw error if error
|
||||
|
|
Loading…
Reference in a new issue