Add test for #9468

This commit is contained in:
Tony Ganch 2017-05-16 15:35:12 +02:00
parent 021b5a9ae0
commit 6d64336978

View file

@ -647,4 +647,20 @@ describe('webContents module', function () {
gen.next()
})
})
describe('History API', () => {
it('should push state after calling history.pushState() from the same url', (done) => {
w.loadURL('about:blank')
w.webContents.once('did-finish-load', () => {
// History should have current page by now.
assert.equal(w.webContents.length(), 1)
w.webContents.executeJavaScript('window.history.pushState({}, "")', (result) => {
// Initial page + pushed state
assert.equal(w.webContents.length(), 2)
done()
})
})
})
})
})