From 6d643369787d99247578a727ead20b5dc13477ec Mon Sep 17 00:00:00 2001 From: Tony Ganch Date: Tue, 16 May 2017 15:35:12 +0200 Subject: [PATCH] Add test for #9468 --- spec/api-web-contents-spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/api-web-contents-spec.js b/spec/api-web-contents-spec.js index 9bbeefc4d7a..03cc990aa6b 100644 --- a/spec/api-web-contents-spec.js +++ b/spec/api-web-contents-spec.js @@ -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() + }) + }) + }) + }) })