161 lines
7.7 KiB
TypeScript
161 lines
7.7 KiB
TypeScript
--- electron/spec/api-app-spec.ts.orig 2026-06-16 14:53:17 UTC
|
|
+++ electron/spec/api-app-spec.ts
|
|
@@ -133,7 +133,7 @@ describe('app module', () => {
|
|
});
|
|
});
|
|
|
|
- ifdescribe(process.platform === 'linux')('app.setDesktopName(name)', () => {
|
|
+ ifdescribe(process.platform === 'linux' || process.platform === 'freebsd')('app.setDesktopName(name)', () => {
|
|
it('sets the desktop name to the CHROME_DESKTOP environment variable', () => {
|
|
const original = process.env.CHROME_DESKTOP;
|
|
defer(() => {
|
|
@@ -162,11 +162,11 @@ describe('app module', () => {
|
|
});
|
|
|
|
describe('app.getPreferredSystemLanguages()', () => {
|
|
- ifit(process.platform !== 'linux')('should not be empty', () => {
|
|
+ ifit(process.platform !== 'linux' && process.platform !== 'freebsd')('should not be empty', () => {
|
|
expect(app.getPreferredSystemLanguages().length).to.not.equal(0);
|
|
});
|
|
|
|
- ifit(process.platform === 'linux')('should be empty or contain C entry', () => {
|
|
+ ifit(process.platform === 'linux' || process.platform === 'freebsd')('should be empty or contain C entry', () => {
|
|
const languages = app.getPreferredSystemLanguages();
|
|
if (languages.length) {
|
|
expect(languages).to.not.include('C');
|
|
@@ -245,7 +245,7 @@ describe('app module', () => {
|
|
expect(code).to.equal(123, 'exit code should be 123, if you see this please tag @MarshallOfSound');
|
|
});
|
|
|
|
- ifit(['darwin', 'linux'].includes(process.platform))('exits gracefully', async function () {
|
|
+ ifit(['darwin', 'linux', 'freebsd'].includes(process.platform))('exits gracefully', async function () {
|
|
const electronPath = process.execPath;
|
|
const appPath = path.join(fixturesPath, 'api', 'singleton');
|
|
appProcess = cp.spawn(electronPath, [appPath]);
|
|
@@ -416,7 +416,7 @@ describe('app module', () => {
|
|
});
|
|
|
|
// GitHub Actions macOS-13 runners used for x64 seem to have a problem with this test.
|
|
- ifdescribe(process.platform !== 'linux' && !isMacOSx64)('app.{add|get|clear}RecentDocument(s)', () => {
|
|
+ ifdescribe(process.platform !== 'linux' && process.platform !== 'freebsd' && !isMacOSx64)('app.{add|get|clear}RecentDocument(s)', () => {
|
|
const tempFiles = [
|
|
path.join(fixturesPath, 'foo.txt'),
|
|
path.join(fixturesPath, 'bar.txt'),
|
|
@@ -545,7 +545,7 @@ describe('app module', () => {
|
|
// let w = null
|
|
|
|
// before(function () {
|
|
- // if (process.platform !== 'linux') {
|
|
+ // if (process.platform !== 'linux' && process.platform !== 'freebsd') {
|
|
// this.skip()
|
|
// }
|
|
// })
|
|
@@ -655,7 +655,7 @@ describe('app module', () => {
|
|
|
|
describe('app.badgeCount', () => {
|
|
const platformIsNotSupported =
|
|
- process.platform === 'win32' || (process.platform === 'linux' && !app.isUnityRunning());
|
|
+ process.platform === 'win32' || (process.platform === 'linux' && !app.isUnityRunning()) || process.platform === 'freebsd';
|
|
|
|
const expectedBadgeCount = 42;
|
|
|
|
@@ -702,7 +702,7 @@ describe('app module', () => {
|
|
});
|
|
|
|
ifdescribe(
|
|
- process.platform !== 'linux' && !process.mas && (process.platform !== 'darwin' || process.arch === 'arm64')
|
|
+ process.platform !== 'linux' && process.platform !== 'freebsd' && !process.mas && (process.platform !== 'darwin' || process.arch === 'arm64')
|
|
)('app.get/setLoginItemSettings API', function () {
|
|
const isMac = process.platform === 'darwin';
|
|
const isWin = process.platform === 'win32';
|
|
@@ -1119,7 +1119,7 @@ describe('app module', () => {
|
|
});
|
|
});
|
|
|
|
- ifdescribe(process.platform !== 'linux')('accessibility support functionality', () => {
|
|
+ ifdescribe(process.platform !== 'linux' && process.platform !== 'freebsd')('accessibility support functionality', () => {
|
|
it('is mutable', () => {
|
|
const values = [false, true, false];
|
|
const setters: Array<(arg: boolean) => void> = [
|
|
@@ -1389,7 +1389,7 @@ describe('app module', () => {
|
|
});
|
|
});
|
|
|
|
- ifdescribe(process.platform !== 'linux')('select-client-certificate event', () => {
|
|
+ ifdescribe(process.platform !== 'linux' && process.platform !== 'freebsd')('select-client-certificate event', () => {
|
|
let w: BrowserWindow;
|
|
|
|
before(function () {
|
|
@@ -1530,7 +1530,7 @@ describe('app module', () => {
|
|
});
|
|
});
|
|
|
|
- ifdescribe(process.platform === 'linux')('default protocol client APIs with mocked XDG settings', () => {
|
|
+ ifdescribe(process.platform === 'linux' || process.platform === 'freebsd')('default protocol client APIs with mocked XDG settings', () => {
|
|
const protocol = 'electron-test-linux';
|
|
const desktopFileId = 'electron-test.desktop';
|
|
const protocolMimeType = `x-scheme-handler/${protocol}`;
|
|
@@ -1620,7 +1620,7 @@ describe('app module', () => {
|
|
|
|
describe('getApplicationNameForProtocol()', () => {
|
|
// TODO: Linux CI doesn't have registered http & https handlers
|
|
- ifit(!(process.env.CI && process.platform === 'linux'))(
|
|
+ ifit(!(process.env.CI && (process.platform === 'linux' || process.platform === 'freebsd')))(
|
|
'returns application names for common protocols',
|
|
function () {
|
|
// We can't expect particular app names here, but these protocols should
|
|
@@ -1637,7 +1637,7 @@ describe('app module', () => {
|
|
expect(app.getApplicationNameForProtocol('bogus-protocol://')).to.equal('');
|
|
});
|
|
|
|
- ifdescribe(process.platform === 'linux')('on Linux with mocked XDG dirs', () => {
|
|
+ ifdescribe(process.platform === 'linux' || process.platform === 'freebsd')('on Linux with mocked XDG dirs', () => {
|
|
const fixtureApp = path.join(fixturesPath, 'api', 'protocol-name');
|
|
const desktopFileId = 'mock-browser.desktop';
|
|
const mockScheme = 'mockproto';
|
|
@@ -1764,7 +1764,7 @@ describe('app module', () => {
|
|
});
|
|
});
|
|
|
|
- ifdescribe(process.platform !== 'linux')('getApplicationInfoForProtocol()', () => {
|
|
+ ifdescribe(process.platform !== 'linux' && process.platform !== 'freebsd')('getApplicationInfoForProtocol()', () => {
|
|
it('returns promise rejection for a bogus protocol', async function () {
|
|
await expect(app.getApplicationInfoForProtocol('bogus-protocol://')).to.eventually.be.rejectedWith(
|
|
'Unable to retrieve installation path to app'
|
|
@@ -1835,7 +1835,7 @@ describe('app module', () => {
|
|
});
|
|
|
|
// FIXME Get these specs running on Linux CI
|
|
- ifdescribe(process.platform !== 'linux')('getFileIcon() API', () => {
|
|
+ ifdescribe(process.platform !== 'linux' && process.platform !== 'freebsd')('getFileIcon() API', () => {
|
|
const iconPath = path.join(__dirname, 'fixtures/assets/icon.ico');
|
|
const sizes = {
|
|
small: 16,
|
|
@@ -1917,7 +1917,7 @@ describe('app module', () => {
|
|
expect(entry.memory).to.have.property('privateBytes').that.is.greaterThan(0);
|
|
}
|
|
|
|
- if (process.platform !== 'linux') {
|
|
+ if (process.platform !== 'linux' && process.platform !== 'freebsd') {
|
|
expect(entry.sandboxed).to.be.a('boolean');
|
|
}
|
|
|
|
@@ -1986,7 +1986,7 @@ describe('app module', () => {
|
|
|
|
it('succeeds with complete GPUInfo', async () => {
|
|
const completeInfo = await getGPUInfo('complete');
|
|
- if (process.platform === 'linux') {
|
|
+ if (process.platform === 'linux' || process.platform === 'freebsd') {
|
|
// For linux and macOS complete info is same as basic info
|
|
await verifyBasicGPUInfo(completeInfo);
|
|
const basicInfo = await getGPUInfo('basic');
|
|
@@ -2010,7 +2010,7 @@ describe('app module', () => {
|
|
});
|
|
});
|
|
|
|
- ifdescribe(!(process.platform === 'linux' && (process.arch === 'arm64' || process.arch === 'arm')))(
|
|
+ ifdescribe(!((process.platform === 'linux' || process.platform === 'freebsd') && (process.arch === 'arm64' || process.arch === 'arm')))(
|
|
'sandbox options',
|
|
() => {
|
|
let appProcess: cp.ChildProcess = null as any;
|