feat: add navigationHistory.getEntryAtIndex(int index)
method (#41662)
* feat: add `navigationHistory.getEntryAtIndex(int index)` method (#41577) * test: fix flaky tests by replacing real urls with data urls * test: remove hardcoded url
This commit is contained in:
parent
e6417c7084
commit
9056dd728a
9 changed files with 148 additions and 8 deletions
|
@ -2200,13 +2200,13 @@ describe('chromium features', () => {
|
|||
const w = new BrowserWindow({ show: false });
|
||||
await w.loadFile(path.join(fixturesPath, 'pages', 'blank.html'));
|
||||
// History should have current page by now.
|
||||
expect(w.webContents.length()).to.equal(1);
|
||||
expect(w.webContents.navigationHistory.length()).to.equal(1);
|
||||
|
||||
const waitCommit = once(w.webContents, 'navigation-entry-committed');
|
||||
w.webContents.executeJavaScript('window.history.pushState({}, "")');
|
||||
await waitCommit;
|
||||
// Initial page + pushed state.
|
||||
expect(w.webContents.length()).to.equal(2);
|
||||
expect(w.webContents.navigationHistory.length()).to.equal(2);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -2234,7 +2234,7 @@ describe('chromium features', () => {
|
|||
});
|
||||
await w.webContents.mainFrame.frames[0].executeJavaScript('window.history.back()');
|
||||
expect(await w.webContents.executeJavaScript('window.history.state')).to.equal(1);
|
||||
expect(w.webContents.getActiveIndex()).to.equal(1);
|
||||
expect(w.webContents.navigationHistory.getActiveIndex()).to.equal(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue