Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: re-enable desktopCapturer specs #33497

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 5 additions & 7 deletions spec-main/api-desktop-capturer-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt

after(closeAllWindows);

// TODO(nornagon): figure out why this test is failing on Linux and re-enable it.
ifit(process.platform !== 'linux')('should return a non-empty array of sources', async () => {
it('should return a non-empty array of sources', async () => {
const sources = await desktopCapturer.getSources({ types: ['window', 'screen'] });
expect(sources).to.be.an('array').that.is.not.empty();
});
Expand All @@ -33,16 +32,15 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
await expect(promise).to.be.eventually.rejectedWith(Error, 'Invalid options');
});

// TODO(nornagon): figure out why this test is failing on Linux and re-enable it.
ifit(process.platform !== 'linux')('does not throw an error when called more than once (regression)', async () => {
it('does not throw an error when called more than once (regression)', async () => {
const sources1 = await desktopCapturer.getSources({ types: ['window', 'screen'] });
expect(sources1).to.be.an('array').that.is.not.empty();

const sources2 = await desktopCapturer.getSources({ types: ['window', 'screen'] });
expect(sources2).to.be.an('array').that.is.not.empty();
});

ifit(process.platform !== 'linux')('responds to subsequent calls of different options', async () => {
it('responds to subsequent calls of different options', async () => {
const promise1 = desktopCapturer.getSources({ types: ['window'] });
await expect(promise1).to.eventually.be.fulfilled();

Expand All @@ -51,7 +49,7 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
});

// Linux doesn't return any window sources.
ifit(process.platform !== 'linux')('returns an empty display_id for window sources on Windows and Mac', async () => {
ifit(process.platform !== 'linux')('returns an empty display_id for window sources', async () => {
const w = new BrowserWindow({ width: 200, height: 200 });
await w.loadURL('about:blank');

Expand All @@ -63,7 +61,7 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
}
});

ifit(process.platform !== 'linux')('returns display_ids matching the Screen API on Windows and Mac', async () => {
ifit(process.platform !== 'linux')('returns display_ids matching the Screen API', async () => {
const displays = screen.getAllDisplays();
const sources = await desktopCapturer.getSources({ types: ['screen'] });
expect(sources).to.be.an('array').of.length(displays.length);
Expand Down