test: use delay() helper (#24321)
This commit is contained in:
parent
8eb198bab4
commit
1c49e4e376
9 changed files with 24 additions and 36 deletions
|
@ -2,13 +2,7 @@ import { expect } from 'chai';
|
|||
import { app, contentTracing, TraceConfig, TraceCategoriesAndOptions } from 'electron/main';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { ifdescribe } from './spec-helpers';
|
||||
|
||||
const timeout = async (milliseconds: number) => {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(resolve, milliseconds);
|
||||
});
|
||||
};
|
||||
import { ifdescribe, delay } from './spec-helpers';
|
||||
|
||||
// FIXME: The tests are skipped on arm/arm64.
|
||||
ifdescribe(!(process.platform === 'linux' && ['arm', 'arm64'].includes(process.arch)))('contentTracing', () => {
|
||||
|
@ -16,7 +10,7 @@ ifdescribe(!(process.platform === 'linux' && ['arm', 'arm64'].includes(process.a
|
|||
await app.whenReady();
|
||||
|
||||
await contentTracing.startRecording(options);
|
||||
await timeout(recordTimeInMilliseconds);
|
||||
await delay(recordTimeInMilliseconds);
|
||||
const resultFilePath = await contentTracing.stopRecording(outputFilePath);
|
||||
|
||||
return resultFilePath;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue