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', ->
|
describe 'cookies module', ->
|
||||||
fixtures = path.resolve __dirname, 'fixtures'
|
fixtures = path.resolve __dirname, 'fixtures'
|
||||||
w = null
|
w = null
|
||||||
url = "http://127.0.0.1:9999"
|
url = "http://127.0.0.1"
|
||||||
|
|
||||||
beforeEach -> w = new BrowserWindow(show: true)
|
beforeEach -> w = new BrowserWindow(show: true)
|
||||||
afterEach -> w.destroy()
|
afterEach -> w.destroy()
|
||||||
|
@ -17,10 +17,12 @@ describe 'cookies module', ->
|
||||||
console.log req
|
console.log req
|
||||||
res.setHeader('Set-Cookie', ['type=dummy'])
|
res.setHeader('Set-Cookie', ['type=dummy'])
|
||||||
res.end('finished')
|
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()
|
{port} = server.address()
|
||||||
w.loadUrl url
|
w.loadUrl "#{url}:#{port}"
|
||||||
w.webContents.on 'did-finish-load', ()->
|
w.webContents.on 'did-finish-load', ()->
|
||||||
w.webContents.session.cookies.get {url: url}, (error, cookies) ->
|
w.webContents.session.cookies.get {url: url}, (error, cookies) ->
|
||||||
throw error if error
|
throw error if error
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue