test: migrate to helpers & disabled tests list (#37513)
* test: migrate to helpers & disabled tests list * can't disable a test suite * correct condition * address review comments
This commit is contained in:
parent
58f3c0ee37
commit
b8a21dbcd7
20 changed files with 95 additions and 117 deletions
|
@ -188,12 +188,7 @@ describe('app module', () => {
|
||||||
expect(code).to.equal(123, 'exit code should be 123, if you see this please tag @MarshallOfSound');
|
expect(code).to.equal(123, 'exit code should be 123, if you see this please tag @MarshallOfSound');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('exits gracefully', async function () {
|
ifit(['darwin', 'linux'].includes(process.platform))('exits gracefully', async function () {
|
||||||
if (!['darwin', 'linux'].includes(process.platform)) {
|
|
||||||
this.skip();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const electronPath = process.execPath;
|
const electronPath = process.execPath;
|
||||||
const appPath = path.join(fixturesPath, 'api', 'singleton');
|
const appPath = path.join(fixturesPath, 'api', 'singleton');
|
||||||
appProcess = cp.spawn(electronPath, [appPath]);
|
appProcess = cp.spawn(electronPath, [appPath]);
|
||||||
|
@ -409,13 +404,7 @@ describe('app module', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('app.setUserActivity(type, userInfo)', () => {
|
ifdescribe(process.platform === 'darwin')('app.setUserActivity(type, userInfo)', () => {
|
||||||
before(function () {
|
|
||||||
if (process.platform !== 'darwin') {
|
|
||||||
this.skip();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
it('sets the current activity', () => {
|
it('sets the current activity', () => {
|
||||||
app.setUserActivity('com.electron.testActivity', { testData: '123' });
|
app.setUserActivity('com.electron.testActivity', { testData: '123' });
|
||||||
expect(app.getCurrentActivityType()).to.equal('com.electron.testActivity');
|
expect(app.getCurrentActivityType()).to.equal('com.electron.testActivity');
|
||||||
|
@ -737,9 +726,7 @@ describe('app module', () => {
|
||||||
expect(app.getLoginItemSettings().openAtLogin).to.equal(false);
|
expect(app.getLoginItemSettings().openAtLogin).to.equal(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('correctly sets and unsets the LoginItem as hidden', function () {
|
ifit(process.platform === 'darwin')('correctly sets and unsets the LoginItem as hidden', function () {
|
||||||
if (process.platform !== 'darwin') this.skip();
|
|
||||||
|
|
||||||
expect(app.getLoginItemSettings().openAtLogin).to.equal(false);
|
expect(app.getLoginItemSettings().openAtLogin).to.equal(false);
|
||||||
expect(app.getLoginItemSettings().openAsHidden).to.equal(false);
|
expect(app.getLoginItemSettings().openAsHidden).to.equal(false);
|
||||||
|
|
||||||
|
@ -1099,13 +1086,10 @@ describe('app module', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('select-client-certificate event', () => {
|
ifdescribe(process.platform !== 'linux')('select-client-certificate event', () => {
|
||||||
let w: BrowserWindow;
|
let w: BrowserWindow;
|
||||||
|
|
||||||
before(function () {
|
before(function () {
|
||||||
if (process.platform === 'linux') {
|
|
||||||
this.skip();
|
|
||||||
}
|
|
||||||
session.fromPartition('empty-certificate').setCertificateVerifyProc((req, cb) => { cb(0); });
|
session.fromPartition('empty-certificate').setCertificateVerifyProc((req, cb) => { cb(0); });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1134,7 +1118,7 @@ describe('app module', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('setAsDefaultProtocolClient(protocol, path, args)', () => {
|
ifdescribe(process.platform === 'win32')('setAsDefaultProtocolClient(protocol, path, args)', () => {
|
||||||
const protocol = 'electron-test';
|
const protocol = 'electron-test';
|
||||||
const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe');
|
const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe');
|
||||||
const processStartArgs = [
|
const processStartArgs = [
|
||||||
|
@ -1146,16 +1130,12 @@ describe('app module', () => {
|
||||||
let classesKey: any;
|
let classesKey: any;
|
||||||
|
|
||||||
before(function () {
|
before(function () {
|
||||||
if (process.platform !== 'win32') {
|
Winreg = require('winreg');
|
||||||
this.skip();
|
|
||||||
} else {
|
|
||||||
Winreg = require('winreg');
|
|
||||||
|
|
||||||
classesKey = new Winreg({
|
classesKey = new Winreg({
|
||||||
hive: Winreg.HKCU,
|
hive: Winreg.HKCU,
|
||||||
key: '\\Software\\Classes\\'
|
key: '\\Software\\Classes\\'
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
after(function (done) {
|
after(function (done) {
|
||||||
|
@ -1240,14 +1220,11 @@ describe('app module', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getApplicationNameForProtocol()', () => {
|
describe('getApplicationNameForProtocol()', () => {
|
||||||
it('returns application names for common protocols', function () {
|
// TODO: Linux CI doesn't have registered http & https handlers
|
||||||
|
ifit(!(process.env.CI && process.platform === 'linux'))('returns application names for common protocols', function () {
|
||||||
// We can't expect particular app names here, but these protocols should
|
// We can't expect particular app names here, but these protocols should
|
||||||
// at least have _something_ registered. Except on our Linux CI
|
// at least have _something_ registered. Except on our Linux CI
|
||||||
// environment apparently.
|
// environment apparently.
|
||||||
if (process.platform === 'linux') {
|
|
||||||
this.skip();
|
|
||||||
}
|
|
||||||
|
|
||||||
const protocols = [
|
const protocols = [
|
||||||
'http://',
|
'http://',
|
||||||
'https://'
|
'https://'
|
||||||
|
@ -1492,28 +1469,25 @@ describe('app module', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('sandbox options', () => {
|
ifdescribe(!(process.platform === 'linux' && (process.arch === 'arm64' || process.arch === 'arm')))('sandbox options', () => {
|
||||||
|
// Our ARM tests are run on VSTS rather than CircleCI, and the Docker
|
||||||
|
// setup on VSTS disallows syscalls that Chrome requires for setting up
|
||||||
|
// sandboxing.
|
||||||
|
// See:
|
||||||
|
// - https://docs.docker.com/engine/security/seccomp/#significant-syscalls-blocked-by-the-default-profile
|
||||||
|
// - https://chromium.googlesource.com/chromium/src/+/70.0.3538.124/sandbox/linux/services/credentials.cc#292
|
||||||
|
// - https://github.com/docker/docker-ce/blob/ba7dfc59ccfe97c79ee0d1379894b35417b40bca/components/engine/profiles/seccomp/seccomp_default.go#L497
|
||||||
|
// - https://blog.jessfraz.com/post/how-to-use-new-docker-seccomp-profiles/
|
||||||
|
//
|
||||||
|
// Adding `--cap-add SYS_ADMIN` or `--security-opt seccomp=unconfined`
|
||||||
|
// to the Docker invocation allows the syscalls that Chrome needs, but
|
||||||
|
// are probably more permissive than we'd like.
|
||||||
|
|
||||||
let appProcess: cp.ChildProcess = null as any;
|
let appProcess: cp.ChildProcess = null as any;
|
||||||
let server: net.Server = null as any;
|
let server: net.Server = null as any;
|
||||||
const socketPath = process.platform === 'win32' ? '\\\\.\\pipe\\electron-mixed-sandbox' : '/tmp/electron-mixed-sandbox';
|
const socketPath = process.platform === 'win32' ? '\\\\.\\pipe\\electron-mixed-sandbox' : '/tmp/electron-mixed-sandbox';
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
if (process.platform === 'linux' && (process.arch === 'arm64' || process.arch === 'arm')) {
|
|
||||||
// Our ARM tests are run on VSTS rather than CircleCI, and the Docker
|
|
||||||
// setup on VSTS disallows syscalls that Chrome requires for setting up
|
|
||||||
// sandboxing.
|
|
||||||
// See:
|
|
||||||
// - https://docs.docker.com/engine/security/seccomp/#significant-syscalls-blocked-by-the-default-profile
|
|
||||||
// - https://chromium.googlesource.com/chromium/src/+/70.0.3538.124/sandbox/linux/services/credentials.cc#292
|
|
||||||
// - https://github.com/docker/docker-ce/blob/ba7dfc59ccfe97c79ee0d1379894b35417b40bca/components/engine/profiles/seccomp/seccomp_default.go#L497
|
|
||||||
// - https://blog.jessfraz.com/post/how-to-use-new-docker-seccomp-profiles/
|
|
||||||
//
|
|
||||||
// Adding `--cap-add SYS_ADMIN` or `--security-opt seccomp=unconfined`
|
|
||||||
// to the Docker invocation allows the syscalls that Chrome needs, but
|
|
||||||
// are probably more permissive than we'd like.
|
|
||||||
this.skip();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
fs.unlink(socketPath, () => {
|
fs.unlink(socketPath, () => {
|
||||||
server = net.createServer();
|
server = net.createServer();
|
||||||
server.listen(socketPath);
|
server.listen(socketPath);
|
||||||
|
@ -1613,8 +1587,7 @@ describe('app module', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const dockDescribe = process.platform === 'darwin' ? describe : describe.skip;
|
ifdescribe(process.platform === 'darwin')('dock APIs', () => {
|
||||||
dockDescribe('dock APIs', () => {
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await app.dock.show();
|
await app.dock.show();
|
||||||
});
|
});
|
||||||
|
|
|
@ -29,6 +29,7 @@ ifdescribe(process.platform === 'darwin' && !(process.env.CI && process.arch ===
|
||||||
if (process.env.CI && !process.env.CIRCLE_PR_NUMBER) {
|
if (process.env.CI && !process.env.CIRCLE_PR_NUMBER) {
|
||||||
throw new Error('No valid signing identity available to run autoUpdater specs');
|
throw new Error('No valid signing identity available to run autoUpdater specs');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.skip();
|
this.skip();
|
||||||
} else {
|
} else {
|
||||||
identity = result.stdout.toString().trim();
|
identity = result.stdout.toString().trim();
|
||||||
|
|
|
@ -359,9 +359,9 @@ describe('BrowserWindow module', () => {
|
||||||
w.loadURL('about:blank');
|
w.loadURL('about:blank');
|
||||||
await readyToShow;
|
await readyToShow;
|
||||||
});
|
});
|
||||||
// TODO(deepak1556): The error code now seems to be `ERR_FAILED`, verify what
|
// DISABLED-FIXME(deepak1556): The error code now seems to be `ERR_FAILED`, verify what
|
||||||
// changed and adjust the test.
|
// changed and adjust the test.
|
||||||
it.skip('should emit did-fail-load event for files that do not exist', async () => {
|
it('should emit did-fail-load event for files that do not exist', async () => {
|
||||||
const didFailLoad = once(w.webContents, 'did-fail-load');
|
const didFailLoad = once(w.webContents, 'did-fail-load');
|
||||||
w.loadURL('file://a.txt');
|
w.loadURL('file://a.txt');
|
||||||
const [, code, desc,, isMainFrame] = await didFailLoad;
|
const [, code, desc,, isMainFrame] = await didFailLoad;
|
||||||
|
@ -4083,9 +4083,9 @@ describe('BrowserWindow module', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// FIXME(MarshallOfSound): This test fails locally 100% of the time, on CI it started failing
|
// DISABLED-FIXME(MarshallOfSound): This test fails locally 100% of the time, on CI it started failing
|
||||||
// when we introduced the compositor recycling patch. Should figure out how to fix this
|
// when we introduced the compositor recycling patch. Should figure out how to fix this
|
||||||
it.skip('visibilityState remains visible if backgroundThrottling is disabled', async () => {
|
it('visibilityState remains visible if backgroundThrottling is disabled', async () => {
|
||||||
const w = new BrowserWindow({
|
const w = new BrowserWindow({
|
||||||
show: false,
|
show: false,
|
||||||
width: 100,
|
width: 100,
|
||||||
|
|
|
@ -23,14 +23,16 @@ ifdescribe(features.isDesktopCapturerEnabled())('setDisplayMediaRequestHandler',
|
||||||
server.close();
|
server.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
// NOTE(nornagon): this test fails on our macOS CircleCI runners with the
|
// FIXME(nornagon): this test fails on our macOS CircleCI runners with the
|
||||||
// error message:
|
// error message:
|
||||||
// [ERROR:video_capture_device_client.cc(659)] error@ OnStart@content/browser/media/capture/desktop_capture_device_mac.cc:98, CGDisplayStreamCreate failed, OS message: Value too large to be stored in data type (84)
|
// [ERROR:video_capture_device_client.cc(659)] error@ OnStart@content/browser/media/capture/desktop_capture_device_mac.cc:98, CGDisplayStreamCreate failed, OS message: Value too large to be stored in data type (84)
|
||||||
// This is possibly related to the OS/VM setup that CircleCI uses for macOS.
|
// This is possibly related to the OS/VM setup that CircleCI uses for macOS.
|
||||||
// Our arm64 runners are in @jkleinsc's office, and are real machines, so the
|
// Our arm64 runners are in @jkleinsc's office, and are real machines, so the
|
||||||
// test works there.
|
// test works there.
|
||||||
ifit(!(process.platform === 'darwin' && process.arch === 'x64'))('works when calling getDisplayMedia', async function () {
|
ifit(!(process.platform === 'darwin' && process.arch === 'x64'))('works when calling getDisplayMedia', async function () {
|
||||||
if ((await desktopCapturer.getSources({ types: ['screen'] })).length === 0) { return this.skip(); }
|
if ((await desktopCapturer.getSources({ types: ['screen'] })).length === 0) {
|
||||||
|
return this.skip();
|
||||||
|
}
|
||||||
const ses = session.fromPartition('' + Math.random());
|
const ses = session.fromPartition('' + Math.random());
|
||||||
let requestHandlerCalled = false;
|
let requestHandlerCalled = false;
|
||||||
let mediaRequest: any = null;
|
let mediaRequest: any = null;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { BrowserWindow, app, Menu, MenuItem, MenuItemConstructorOptions } from 'electron/main';
|
import { BrowserWindow, app, Menu, MenuItem, MenuItemConstructorOptions } from 'electron/main';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
|
import { ifdescribe } from './lib/spec-helpers';
|
||||||
import { closeAllWindows } from './lib/window-helpers';
|
import { closeAllWindows } from './lib/window-helpers';
|
||||||
import { roleList, execute } from '../lib/browser/api/menu-item-roles';
|
import { roleList, execute } from '../lib/browser/api/menu-item-roles';
|
||||||
|
|
||||||
|
@ -280,13 +281,7 @@ describe('MenuItems', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('MenuItem appMenu', () => {
|
ifdescribe(process.platform === 'darwin')('MenuItem appMenu', () => {
|
||||||
before(function () {
|
|
||||||
if (process.platform !== 'darwin') {
|
|
||||||
this.skip();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
it('includes a default submenu layout when submenu is empty', () => {
|
it('includes a default submenu layout when submenu is empty', () => {
|
||||||
const item = new MenuItem({ role: 'appMenu' });
|
const item = new MenuItem({ role: 'appMenu' });
|
||||||
|
|
||||||
|
|
|
@ -891,8 +891,8 @@ describe('Menu module', function () {
|
||||||
expect(Menu.getApplicationMenu()).to.not.be.null('application menu');
|
expect(Menu.getApplicationMenu()).to.not.be.null('application menu');
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO(nornagon): this causes the focus handling tests to fail
|
// DISABLED-FIXME(nornagon): this causes the focus handling tests to fail
|
||||||
it.skip('unsets a menu with null', () => {
|
it('unsets a menu with null', () => {
|
||||||
Menu.setApplicationMenu(null);
|
Menu.setApplicationMenu(null);
|
||||||
expect(Menu.getApplicationMenu()).to.be.null('application menu');
|
expect(Menu.getApplicationMenu()).to.be.null('application menu');
|
||||||
});
|
});
|
||||||
|
|
|
@ -204,9 +204,9 @@ describe('process module', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('process.takeHeapSnapshot()', () => {
|
describe('process.takeHeapSnapshot()', () => {
|
||||||
// TODO(nornagon): this seems to take a really long time when run in the
|
// DISABLED-FIXME(nornagon): this seems to take a really long time when run in the
|
||||||
// main process, for unknown reasons.
|
// main process, for unknown reasons.
|
||||||
it.skip('returns true on success', () => {
|
it('returns true on success', () => {
|
||||||
const filePath = path.join(app.getPath('temp'), 'test.heapsnapshot');
|
const filePath = path.join(app.getPath('temp'), 'test.heapsnapshot');
|
||||||
defer(() => {
|
defer(() => {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -282,7 +282,8 @@ describe('protocol module', () => {
|
||||||
ipcMain.once('loaded-iframe-custom-protocol', () => done());
|
ipcMain.once('loaded-iframe-custom-protocol', () => done());
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('throws an error when custom headers are invalid', (done) => {
|
// DISABLED-FIXME
|
||||||
|
it('throws an error when custom headers are invalid', (done) => {
|
||||||
registerFileProtocol(protocolName, (request, callback) => {
|
registerFileProtocol(protocolName, (request, callback) => {
|
||||||
expect(() => callback({
|
expect(() => callback({
|
||||||
path: filePath,
|
path: filePath,
|
||||||
|
@ -879,7 +880,8 @@ describe('protocol module', () => {
|
||||||
await requestReceived;
|
await requestReceived;
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('can access files through the FileSystem API', (done) => {
|
// DISABLED-FIXME
|
||||||
|
it('can access files through the FileSystem API', (done) => {
|
||||||
const filePath = path.join(fixturesPath, 'pages', 'filesystem.html');
|
const filePath = path.join(fixturesPath, 'pages', 'filesystem.html');
|
||||||
protocol.registerFileProtocol(standardScheme, (request, callback) => callback({ path: filePath }));
|
protocol.registerFileProtocol(standardScheme, (request, callback) => callback({ path: filePath }));
|
||||||
w.loadURL(origin);
|
w.loadURL(origin);
|
||||||
|
@ -928,8 +930,8 @@ describe('protocol module', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// FIXME: Figure out why this test is failing
|
// DISABLED-FIXME: Figure out why this test is failing
|
||||||
it.skip('disallows CORS and fetch requests when only supportFetchAPI is specified', async () => {
|
it('disallows CORS and fetch requests when only supportFetchAPI is specified', async () => {
|
||||||
await allowsCORSRequests('no-cors', ['failed xhr', 'failed fetch'], /has been blocked by CORS policy/, () => {
|
await allowsCORSRequests('no-cors', ['failed xhr', 'failed fetch'], /has been blocked by CORS policy/, () => {
|
||||||
const { ipcRenderer } = require('electron');
|
const { ipcRenderer } = require('electron');
|
||||||
Promise.all([
|
Promise.all([
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import { screen } from 'electron/main';
|
import { screen } from 'electron/main';
|
||||||
|
import { ifit } from './lib/spec-helpers';
|
||||||
|
|
||||||
describe('screen module', () => {
|
describe('screen module', () => {
|
||||||
describe('methods reassignment', () => {
|
describe('methods reassignment', () => {
|
||||||
|
@ -28,8 +29,7 @@ describe('screen module', () => {
|
||||||
expect(display).to.be.an('object');
|
expect(display).to.be.an('object');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has the correct non-object properties', function () {
|
ifit(process.platform !== 'linux')('has the correct non-object properties', function () {
|
||||||
if (process.platform === 'linux') this.skip();
|
|
||||||
const display = screen.getPrimaryDisplay();
|
const display = screen.getPrimaryDisplay();
|
||||||
|
|
||||||
expect(display).to.have.property('scaleFactor').that.is.a('number');
|
expect(display).to.have.property('scaleFactor').that.is.a('number');
|
||||||
|
@ -46,8 +46,7 @@ describe('screen module', () => {
|
||||||
expect(display).to.have.property('displayFrequency').that.is.a('number');
|
expect(display).to.have.property('displayFrequency').that.is.a('number');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has a size object property', function () {
|
ifit(process.platform !== 'linux')('has a size object property', function () {
|
||||||
if (process.platform === 'linux') this.skip();
|
|
||||||
const display = screen.getPrimaryDisplay();
|
const display = screen.getPrimaryDisplay();
|
||||||
|
|
||||||
expect(display).to.have.property('size').that.is.an('object');
|
expect(display).to.have.property('size').that.is.an('object');
|
||||||
|
@ -56,8 +55,7 @@ describe('screen module', () => {
|
||||||
expect(size).to.have.property('height').that.is.greaterThan(0);
|
expect(size).to.have.property('height').that.is.greaterThan(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has a workAreaSize object property', function () {
|
ifit(process.platform !== 'linux')('has a workAreaSize object property', function () {
|
||||||
if (process.platform === 'linux') this.skip();
|
|
||||||
const display = screen.getPrimaryDisplay();
|
const display = screen.getPrimaryDisplay();
|
||||||
|
|
||||||
expect(display).to.have.property('workAreaSize').that.is.an('object');
|
expect(display).to.have.property('workAreaSize').that.is.an('object');
|
||||||
|
@ -66,8 +64,7 @@ describe('screen module', () => {
|
||||||
expect(workAreaSize).to.have.property('height').that.is.greaterThan(0);
|
expect(workAreaSize).to.have.property('height').that.is.greaterThan(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has a bounds object property', function () {
|
ifit(process.platform !== 'linux')('has a bounds object property', function () {
|
||||||
if (process.platform === 'linux') this.skip();
|
|
||||||
const display = screen.getPrimaryDisplay();
|
const display = screen.getPrimaryDisplay();
|
||||||
|
|
||||||
expect(display).to.have.property('bounds').that.is.an('object');
|
expect(display).to.have.property('bounds').that.is.an('object');
|
||||||
|
|
|
@ -172,7 +172,8 @@ describe('session module', () => {
|
||||||
expect(list.some(cookie => cookie.name === name && cookie.value === value)).to.equal(false);
|
expect(list.some(cookie => cookie.name === name && cookie.value === value)).to.equal(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('should set cookie for standard scheme', async () => {
|
// DISABLED-FIXME
|
||||||
|
it('should set cookie for standard scheme', async () => {
|
||||||
const { cookies } = session.defaultSession;
|
const { cookies } = session.defaultSession;
|
||||||
const domain = 'fake-host';
|
const domain = 'fake-host';
|
||||||
const url = `${standardScheme}://${domain}`;
|
const url = `${standardScheme}://${domain}`;
|
||||||
|
|
|
@ -5,7 +5,7 @@ import * as fs from 'fs';
|
||||||
import * as http from 'http';
|
import * as http from 'http';
|
||||||
import { BrowserWindow, ipcMain, webContents, session, app, BrowserView } from 'electron/main';
|
import { BrowserWindow, ipcMain, webContents, session, app, BrowserView } from 'electron/main';
|
||||||
import { closeAllWindows } from './lib/window-helpers';
|
import { closeAllWindows } from './lib/window-helpers';
|
||||||
import { ifdescribe, defer, waitUntil, listen } from './lib/spec-helpers';
|
import { ifdescribe, defer, waitUntil, listen, ifit } from './lib/spec-helpers';
|
||||||
import { once } from 'events';
|
import { once } from 'events';
|
||||||
import { setTimeout } from 'timers/promises';
|
import { setTimeout } from 'timers/promises';
|
||||||
|
|
||||||
|
@ -372,10 +372,9 @@ describe('webContents module', () => {
|
||||||
.and.have.property('code', 'ERR_FILE_NOT_FOUND');
|
.and.have.property('code', 'ERR_FILE_NOT_FOUND');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Temporarily disable on WOA until
|
// FIXME: Temporarily disable on WOA until
|
||||||
// https://github.com/electron/electron/issues/20008 is resolved
|
// https://github.com/electron/electron/issues/20008 is resolved
|
||||||
const testFn = (process.platform === 'win32' && process.arch === 'arm64' ? it.skip : it);
|
ifit(!(process.platform === 'win32' && process.arch === 'arm64'))('rejects when loading fails due to DNS not resolved', async () => {
|
||||||
testFn('rejects when loading fails due to DNS not resolved', async () => {
|
|
||||||
await expect(w.loadURL('https://err.name.not.resolved')).to.eventually.be.rejected()
|
await expect(w.loadURL('https://err.name.not.resolved')).to.eventually.be.rejected()
|
||||||
.and.have.property('code', 'ERR_NAME_NOT_RESOLVED');
|
.and.have.property('code', 'ERR_NAME_NOT_RESOLVED');
|
||||||
});
|
});
|
||||||
|
@ -489,8 +488,8 @@ describe('webContents module', () => {
|
||||||
describe('getFocusedWebContents() API', () => {
|
describe('getFocusedWebContents() API', () => {
|
||||||
afterEach(closeAllWindows);
|
afterEach(closeAllWindows);
|
||||||
|
|
||||||
const testFn = (process.platform === 'win32' && process.arch === 'arm64' ? it.skip : it);
|
// FIXME
|
||||||
testFn('returns the focused web contents', async () => {
|
ifit(!(process.platform === 'win32' && process.arch === 'arm64'))('returns the focused web contents', async () => {
|
||||||
const w = new BrowserWindow({ show: true });
|
const w = new BrowserWindow({ show: true });
|
||||||
await w.loadFile(path.join(__dirname, 'fixtures', 'blank.html'));
|
await w.loadFile(path.join(__dirname, 'fixtures', 'blank.html'));
|
||||||
expect(webContents.getFocusedWebContents().id).to.equal(w.webContents.id);
|
expect(webContents.getFocusedWebContents().id).to.equal(w.webContents.id);
|
||||||
|
|
|
@ -185,9 +185,8 @@ describe('webFrameMain module', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('WebFrame.visibilityState', () => {
|
describe('WebFrame.visibilityState', () => {
|
||||||
// TODO(MarshallOfSound): Fix flaky test
|
// DISABLED-FIXME(MarshallOfSound): Fix flaky test
|
||||||
// @flaky-test
|
it('should match window state', async () => {
|
||||||
it.skip('should match window state', async () => {
|
|
||||||
const w = new BrowserWindow({ show: true });
|
const w = new BrowserWindow({ show: true });
|
||||||
await w.loadURL('about:blank');
|
await w.loadURL('about:blank');
|
||||||
const webFrame = w.webContents.mainFrame;
|
const webFrame = w.webContents.mainFrame;
|
||||||
|
|
|
@ -1410,8 +1410,8 @@ describe('asar package', function () {
|
||||||
expect(process.noAsar).to.be.false();
|
expect(process.noAsar).to.be.false();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
/*
|
|
||||||
|
|
||||||
|
/*
|
||||||
describe('process.env.ELECTRON_NO_ASAR', function () {
|
describe('process.env.ELECTRON_NO_ASAR', function () {
|
||||||
before(function () {
|
before(function () {
|
||||||
if (!features.isRunAsNodeEnabled()) {
|
if (!features.isRunAsNodeEnabled()) {
|
||||||
|
|
|
@ -19,9 +19,9 @@ const features = process._linkedBinding('electron_common_features');
|
||||||
const fixturesPath = path.resolve(__dirname, 'fixtures');
|
const fixturesPath = path.resolve(__dirname, 'fixtures');
|
||||||
|
|
||||||
describe('reporting api', () => {
|
describe('reporting api', () => {
|
||||||
// TODO(nornagon): this started failing a lot on CI. Figure out why and fix
|
// FIXME(nornagon): this started failing a lot on CI. Figure out why and fix
|
||||||
// it.
|
// it.
|
||||||
it.skip('sends a report for a deprecation', async () => {
|
it('sends a report for a deprecation', async () => {
|
||||||
const reports = new EventEmitter();
|
const reports = new EventEmitter();
|
||||||
|
|
||||||
// The Reporting API only works on https with valid certs. To dodge having
|
// The Reporting API only works on https with valid certs. To dodge having
|
||||||
|
@ -1107,8 +1107,8 @@ describe('chromium features', () => {
|
||||||
expect(frameName).to.equal('__proto__');
|
expect(frameName).to.equal('__proto__');
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO(nornagon): I'm not sure this ... ever was correct?
|
// FIXME(nornagon): I'm not sure this ... ever was correct?
|
||||||
it.skip('inherit options of parent window', async () => {
|
xit('inherit options of parent window', async () => {
|
||||||
const w = new BrowserWindow({ show: false, width: 123, height: 456 });
|
const w = new BrowserWindow({ show: false, width: 123, height: 456 });
|
||||||
w.loadFile(path.resolve(__dirname, 'fixtures', 'blank.html'));
|
w.loadFile(path.resolve(__dirname, 'fixtures', 'blank.html'));
|
||||||
const url = `file://${fixturesPath}/pages/window-open-size.html`;
|
const url = `file://${fixturesPath}/pages/window-open-size.html`;
|
||||||
|
@ -2214,14 +2214,11 @@ describe('chromium features', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// FIXME(nornagon): this is broken on CI, it triggers:
|
||||||
|
// [FATAL:speech_synthesis.mojom-shared.h(237)] The outgoing message will
|
||||||
|
// trigger VALIDATION_ERROR_UNEXPECTED_NULL_POINTER at the receiving side
|
||||||
|
// (null text in SpeechSynthesisUtterance struct).
|
||||||
ifdescribe(features.isTtsEnabled())('SpeechSynthesis', () => {
|
ifdescribe(features.isTtsEnabled())('SpeechSynthesis', () => {
|
||||||
before(function () {
|
|
||||||
// TODO(nornagon): this is broken on CI, it triggers:
|
|
||||||
// [FATAL:speech_synthesis.mojom-shared.h(237)] The outgoing message will
|
|
||||||
// trigger VALIDATION_ERROR_UNEXPECTED_NULL_POINTER at the receiving side
|
|
||||||
// (null text in SpeechSynthesisUtterance struct).
|
|
||||||
this.skip();
|
|
||||||
});
|
|
||||||
itremote('should emit lifecycle events', async () => {
|
itremote('should emit lifecycle events', async () => {
|
||||||
const sentence = `long sentence which will take at least a few seconds to
|
const sentence = `long sentence which will take at least a few seconds to
|
||||||
utter so that it's possible to pause and resume before the end`;
|
utter so that it's possible to pause and resume before the end`;
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
[
|
[
|
||||||
"// NOTE: this file is used to disable tests in our test suite by their full title."
|
"// NOTE: this file is used to disable tests in our test suite by their full title.",
|
||||||
|
"BrowserWindow module BrowserWindow.loadURL(url) should emit did-fail-load event for files that do not exist",
|
||||||
|
"BrowserWindow module document.visibilityState/hidden visibilityState remains visible if backgroundThrottling is disabled",
|
||||||
|
"Menu module Menu.setApplicationMenu unsets a menu with null",
|
||||||
|
"process module main process process.takeHeapSnapshot() returns true on success",
|
||||||
|
"protocol module protocol.registerFileProtocol throws an error when custom headers are invalid",
|
||||||
|
"protocol module protocol.registerProtocol throws an error when custom headers are invalid",
|
||||||
|
"protocol module protocol.registerSchemesAsPrivileged standard can access files through the FileSystem API",
|
||||||
|
"protocol module protocol.registerSchemesAsPrivileged cors-fetch disallows CORS and fetch requests when only supportFetchAPI is specified",
|
||||||
|
"session module ses.cookies should set cookie for standard scheme",
|
||||||
|
"webFrameMain module WebFrame.visibilityState should match window state",
|
||||||
|
"reporting api sends a report for a deprecation",
|
||||||
|
"chromium features SpeechSynthesis should emit lifecycle events",
|
||||||
|
"version-bumper nextVersion bump versions bumps to beta from nightly"
|
||||||
]
|
]
|
|
@ -589,9 +589,9 @@ describe('chrome extensions', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO(nornagon): real extensions don't load on file: urls, so this
|
// FIXME(nornagon): real extensions don't load on file: urls, so this
|
||||||
// test needs to be updated to serve its content over http.
|
// test needs to be updated to serve its content over http.
|
||||||
describe.skip('supports "all_frames" option', () => {
|
xdescribe('supports "all_frames" option', () => {
|
||||||
const contentScript = path.resolve(fixtures, 'extensions/content-script');
|
const contentScript = path.resolve(fixtures, 'extensions/content-script');
|
||||||
|
|
||||||
// Computed style values
|
// Computed style values
|
||||||
|
|
|
@ -73,6 +73,7 @@ app.whenReady().then(async () => {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
mocha.suite.beforeEach(function () {
|
mocha.suite.beforeEach(function () {
|
||||||
|
// TODO(clavin): add support for disabling *suites* by title, not just tests
|
||||||
if (disabledTests.has(this.currentTest?.fullTitle())) {
|
if (disabledTests.has(this.currentTest?.fullTitle())) {
|
||||||
this.skip();
|
this.skip();
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,8 +132,8 @@ describe('version-bumper', () => {
|
||||||
).to.be.rejectedWith('Cannot bump to beta from stable.');
|
).to.be.rejectedWith('Cannot bump to beta from stable.');
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO ELECTRON 15: Re-enable after Electron 15 alpha has released
|
// DISABLED-FIXME(ELECTRON 15): Re-enable after Electron 15 alpha has released
|
||||||
it.skip('bumps to beta from nightly', async () => {
|
it('bumps to beta from nightly', async () => {
|
||||||
const version = 'v2.0.0-nightly.19950901';
|
const version = 'v2.0.0-nightly.19950901';
|
||||||
const next = await nextVersion('beta', version);
|
const next = await nextVersion('beta', version);
|
||||||
const matches = next.match(betaPattern);
|
const matches = next.match(betaPattern);
|
||||||
|
|
|
@ -109,13 +109,9 @@ ifdescribe(process.platform !== 'linux')('document.visibilityState', () => {
|
||||||
await once(ipcMain, 'visibility-change-visible');
|
await once(ipcMain, 'visibility-change-visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('on platforms that support occlusion detection', () => {
|
ifdescribe(process.platform === 'darwin')('on platforms that support occlusion detection', () => {
|
||||||
let child: cp.ChildProcess;
|
let child: cp.ChildProcess;
|
||||||
|
|
||||||
before(function () {
|
|
||||||
if (process.platform !== 'darwin') this.skip();
|
|
||||||
});
|
|
||||||
|
|
||||||
const makeOtherWindow = (opts: { x: number; y: number; width: number; height: number; }) => {
|
const makeOtherWindow = (opts: { x: number; y: number; width: number; height: number; }) => {
|
||||||
child = cp.spawn(process.execPath, [path.resolve(__dirname, 'fixtures', 'chromium', 'other-window.js'), `${opts.x}`, `${opts.y}`, `${opts.width}`, `${opts.height}`]);
|
child = cp.spawn(process.execPath, [path.resolve(__dirname, 'fixtures', 'chromium', 'other-window.js'), `${opts.x}`, `${opts.y}`, `${opts.width}`, `${opts.height}`]);
|
||||||
return new Promise<void>(resolve => {
|
return new Promise<void>(resolve => {
|
||||||
|
|
|
@ -267,7 +267,7 @@ describe('<webview> tag', function () {
|
||||||
|
|
||||||
describe('devtools', () => {
|
describe('devtools', () => {
|
||||||
afterEach(closeAllWindows);
|
afterEach(closeAllWindows);
|
||||||
// This test is flaky on WOA, so skip it there.
|
// FIXME: This test is flaky on WOA, so skip it there.
|
||||||
ifit(process.platform !== 'win32' || process.arch !== 'arm64')('loads devtools extensions registered on the parent window', async () => {
|
ifit(process.platform !== 'win32' || process.arch !== 'arm64')('loads devtools extensions registered on the parent window', async () => {
|
||||||
const w = new BrowserWindow({
|
const w = new BrowserWindow({
|
||||||
show: false,
|
show: false,
|
||||||
|
@ -1745,7 +1745,9 @@ describe('<webview> tag', function () {
|
||||||
|
|
||||||
describe('media-started-playing and media-paused events', () => {
|
describe('media-started-playing and media-paused events', () => {
|
||||||
it('emits when audio starts and stops playing', async function () {
|
it('emits when audio starts and stops playing', async function () {
|
||||||
if (!await w.executeJavaScript('document.createElement(\'audio\').canPlayType(\'audio/wav\')')) { return this.skip(); }
|
if (!await w.executeJavaScript('document.createElement(\'audio\').canPlayType(\'audio/wav\')')) {
|
||||||
|
return this.skip();
|
||||||
|
}
|
||||||
|
|
||||||
await loadWebView(w, { src: blankPageUrl });
|
await loadWebView(w, { src: blankPageUrl });
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue