diff --git a/spec/api-web-contents-spec.js b/spec/api-web-contents-spec.js index 03cc990aa6bc..9bbeefc4d7a8 100644 --- a/spec/api-web-contents-spec.js +++ b/spec/api-web-contents-spec.js @@ -647,20 +647,4 @@ 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() - }) - }) - }) - }) }) diff --git a/spec/chromium-spec.js b/spec/chromium-spec.js index fe132166d602..32f774f9ffd2 100644 --- a/spec/chromium-spec.js +++ b/spec/chromium-spec.js @@ -1100,11 +1100,32 @@ describe('chromium feature', function () { }) }) - describe('window.history.go(offset)', function () { - it('throws an exception when the argumnet cannot be converted to a string', function () { - assert.throws(function () { - window.history.go({toString: null}) - }, /Cannot convert object to primitive value/) + describe('window.history', function () { + describe('window.history.go(offset)', function () { + it('throws an exception when the argumnet cannot be converted to a string', function () { + assert.throws(function () { + window.history.go({toString: null}) + }, /Cannot convert object to primitive value/) + }) + }) + + describe('window.history.pushState', function () { + it('should push state after calling history.pushState() from the same url', (done) => { + w = new BrowserWindow({ + show: false + }) + 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({}, "")', () => { + // Initial page + pushed state + assert.equal(w.webContents.length(), 2) + done() + }) + }) + }) }) }) })