test: use node helpers for events.once and setTimeout promise (#37374)
This commit is contained in:
parent
46c8b9c728
commit
a3e3efe4c4
47 changed files with 932 additions and 927 deletions
|
@ -1,8 +1,8 @@
|
|||
import { BrowserWindow } from 'electron';
|
||||
import * as path from 'path';
|
||||
import { delay } from './lib/spec-helpers';
|
||||
import { expect } from 'chai';
|
||||
import { closeAllWindows } from './lib/window-helpers';
|
||||
import { setTimeout } from 'timers/promises';
|
||||
|
||||
const fixturesPath = path.resolve(__dirname, 'fixtures');
|
||||
|
||||
|
@ -17,7 +17,7 @@ describe('autofill', () => {
|
|||
const inputText = 'clap';
|
||||
for (const keyCode of inputText) {
|
||||
w.webContents.sendInputEvent({ type: 'char', keyCode });
|
||||
await delay(100);
|
||||
await setTimeout(100);
|
||||
}
|
||||
|
||||
w.webContents.sendInputEvent({ type: 'keyDown', keyCode: 'Down' });
|
||||
|
@ -36,7 +36,7 @@ describe('autofill', () => {
|
|||
w.webContents.sendInputEvent({ type: 'keyDown', keyCode: 'Tab' });
|
||||
w.webContents.sendInputEvent({ type: 'keyDown', keyCode });
|
||||
w.webContents.sendInputEvent({ type: 'char', keyCode });
|
||||
await delay(100);
|
||||
await setTimeout(100);
|
||||
}
|
||||
|
||||
w.webContents.sendInputEvent({ type: 'keyDown', keyCode: 'Tab' });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue