spec: "will-navigate" event
This commit is contained in:
parent
c2975d2bcc
commit
eaacf0a6ef
2 changed files with 15 additions and 0 deletions
|
@ -208,3 +208,11 @@ describe 'browser-window module', ->
|
|||
w.once 'minimize', -> done()
|
||||
w.show()
|
||||
w.minimize()
|
||||
|
||||
describe 'will-navigate event', ->
|
||||
it 'emits when user starts a navigation', (done) ->
|
||||
w.webContents.on 'will-navigate', (event, url) ->
|
||||
event.preventDefault()
|
||||
assert.equal url, 'https://www.github.com/'
|
||||
done()
|
||||
w.loadUrl "file://#{fixtures}/pages/will-navigate.html"
|
||||
|
|
7
spec/fixtures/pages/will-navigate.html
vendored
Normal file
7
spec/fixtures/pages/will-navigate.html
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<body>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
location = 'https://www.github.com'
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue