@@ -188,12 +188,7 @@ describe('app module', () => {
188
188
expect ( code ) . to . equal ( 123 , 'exit code should be 123, if you see this please tag @MarshallOfSound' ) ;
189
189
} ) ;
190
190
191
- it ( 'exits gracefully' , async function ( ) {
192
- if ( ! [ 'darwin' , 'linux' ] . includes ( process . platform ) ) {
193
- this . skip ( ) ;
194
- return ;
195
- }
196
-
191
+ ifit ( [ 'darwin' , 'linux' ] . includes ( process . platform ) ) ( 'exits gracefully' , async function ( ) {
197
192
const electronPath = process . execPath ;
198
193
const appPath = path . join ( fixturesPath , 'api' , 'singleton' ) ;
199
194
appProcess = cp . spawn ( electronPath , [ appPath ] ) ;
@@ -409,13 +404,7 @@ describe('app module', () => {
409
404
} ) ;
410
405
} ) ;
411
406
412
- describe ( 'app.setUserActivity(type, userInfo)' , ( ) => {
413
- before ( function ( ) {
414
- if ( process . platform !== 'darwin' ) {
415
- this . skip ( ) ;
416
- }
417
- } ) ;
418
-
407
+ ifdescribe ( process . platform === 'darwin' ) ( 'app.setUserActivity(type, userInfo)' , ( ) => {
419
408
it ( 'sets the current activity' , ( ) => {
420
409
app . setUserActivity ( 'com.electron.testActivity' , { testData : '123' } ) ;
421
410
expect ( app . getCurrentActivityType ( ) ) . to . equal ( 'com.electron.testActivity' ) ;
@@ -737,9 +726,7 @@ describe('app module', () => {
737
726
expect ( app . getLoginItemSettings ( ) . openAtLogin ) . to . equal ( false ) ;
738
727
} ) ;
739
728
740
- it ( 'correctly sets and unsets the LoginItem as hidden' , function ( ) {
741
- if ( process . platform !== 'darwin' ) this . skip ( ) ;
742
-
729
+ ifit ( process . platform === 'darwin' ) ( 'correctly sets and unsets the LoginItem as hidden' , function ( ) {
743
730
expect ( app . getLoginItemSettings ( ) . openAtLogin ) . to . equal ( false ) ;
744
731
expect ( app . getLoginItemSettings ( ) . openAsHidden ) . to . equal ( false ) ;
745
732
@@ -1099,13 +1086,10 @@ describe('app module', () => {
1099
1086
} ) ;
1100
1087
} ) ;
1101
1088
1102
- describe ( 'select-client-certificate event' , ( ) => {
1089
+ ifdescribe ( process . platform !== 'linux' ) ( 'select-client-certificate event' , ( ) => {
1103
1090
let w : BrowserWindow ;
1104
1091
1105
1092
before ( function ( ) {
1106
- if ( process . platform === 'linux' ) {
1107
- this . skip ( ) ;
1108
- }
1109
1093
session . fromPartition ( 'empty-certificate' ) . setCertificateVerifyProc ( ( req , cb ) => { cb ( 0 ) ; } ) ;
1110
1094
} ) ;
1111
1095
@@ -1134,7 +1118,7 @@ describe('app module', () => {
1134
1118
} ) ;
1135
1119
} ) ;
1136
1120
1137
- describe ( 'setAsDefaultProtocolClient(protocol, path, args)' , ( ) => {
1121
+ ifdescribe ( process . platform === 'win32' ) ( 'setAsDefaultProtocolClient(protocol, path, args)' , ( ) => {
1138
1122
const protocol = 'electron-test' ;
1139
1123
const updateExe = path . resolve ( path . dirname ( process . execPath ) , '..' , 'Update.exe' ) ;
1140
1124
const processStartArgs = [
@@ -1146,16 +1130,12 @@ describe('app module', () => {
1146
1130
let classesKey : any ;
1147
1131
1148
1132
before ( function ( ) {
1149
- if ( process . platform !== 'win32' ) {
1150
- this . skip ( ) ;
1151
- } else {
1152
- Winreg = require ( 'winreg' ) ;
1133
+ Winreg = require ( 'winreg' ) ;
1153
1134
1154
- classesKey = new Winreg ( {
1155
- hive : Winreg . HKCU ,
1156
- key : '\\Software\\Classes\\'
1157
- } ) ;
1158
- }
1135
+ classesKey = new Winreg ( {
1136
+ hive : Winreg . HKCU ,
1137
+ key : '\\Software\\Classes\\'
1138
+ } ) ;
1159
1139
} ) ;
1160
1140
1161
1141
after ( function ( done ) {
@@ -1240,14 +1220,11 @@ describe('app module', () => {
1240
1220
} ) ;
1241
1221
1242
1222
describe ( 'getApplicationNameForProtocol()' , ( ) => {
1243
- it ( 'returns application names for common protocols' , function ( ) {
1223
+ // TODO: Linux CI doesn't have registered http & https handlers
1224
+ ifit ( ! ( process . env . CI && process . platform === 'linux' ) ) ( 'returns application names for common protocols' , function ( ) {
1244
1225
// We can't expect particular app names here, but these protocols should
1245
1226
// at least have _something_ registered. Except on our Linux CI
1246
1227
// environment apparently.
1247
- if ( process . platform === 'linux' ) {
1248
- this . skip ( ) ;
1249
- }
1250
-
1251
1228
const protocols = [
1252
1229
'http://' ,
1253
1230
'https://'
@@ -1492,28 +1469,25 @@ describe('app module', () => {
1492
1469
} ) ;
1493
1470
} ) ;
1494
1471
1495
- describe ( 'sandbox options' , ( ) => {
1472
+ ifdescribe ( ! ( process . platform === 'linux' && ( process . arch === 'arm64' || process . arch === 'arm' ) ) ) ( 'sandbox options' , ( ) => {
1473
+ // Our ARM tests are run on VSTS rather than CircleCI, and the Docker
1474
+ // setup on VSTS disallows syscalls that Chrome requires for setting up
1475
+ // sandboxing.
1476
+ // See:
1477
+ // - https://docs.docker.com/engine/security/seccomp/#significant-syscalls-blocked-by-the-default-profile
1478
+ // - https://chromium.googlesource.com/chromium/src/+/70.0.3538.124/sandbox/linux/services/credentials.cc#292
1479
+ // - https://github.com/docker/docker-ce/blob/ba7dfc59ccfe97c79ee0d1379894b35417b40bca/components/engine/profiles/seccomp/seccomp_default.go#L497
1480
+ // - https://blog.jessfraz.com/post/how-to-use-new-docker-seccomp-profiles/
1481
+ //
1482
+ // Adding `--cap-add SYS_ADMIN` or `--security-opt seccomp=unconfined`
1483
+ // to the Docker invocation allows the syscalls that Chrome needs, but
1484
+ // are probably more permissive than we'd like.
1485
+
1496
1486
let appProcess : cp . ChildProcess = null as any ;
1497
1487
let server : net . Server = null as any ;
1498
1488
const socketPath = process . platform === 'win32' ? '\\\\.\\pipe\\electron-mixed-sandbox' : '/tmp/electron-mixed-sandbox' ;
1499
1489
1500
1490
beforeEach ( function ( done ) {
1501
- if ( process . platform === 'linux' && ( process . arch === 'arm64' || process . arch === 'arm' ) ) {
1502
- // Our ARM tests are run on VSTS rather than CircleCI, and the Docker
1503
- // setup on VSTS disallows syscalls that Chrome requires for setting up
1504
- // sandboxing.
1505
- // See:
1506
- // - https://docs.docker.com/engine/security/seccomp/#significant-syscalls-blocked-by-the-default-profile
1507
- // - https://chromium.googlesource.com/chromium/src/+/70.0.3538.124/sandbox/linux/services/credentials.cc#292
1508
- // - https://github.com/docker/docker-ce/blob/ba7dfc59ccfe97c79ee0d1379894b35417b40bca/components/engine/profiles/seccomp/seccomp_default.go#L497
1509
- // - https://blog.jessfraz.com/post/how-to-use-new-docker-seccomp-profiles/
1510
- //
1511
- // Adding `--cap-add SYS_ADMIN` or `--security-opt seccomp=unconfined`
1512
- // to the Docker invocation allows the syscalls that Chrome needs, but
1513
- // are probably more permissive than we'd like.
1514
- this . skip ( ) ;
1515
- return ;
1516
- }
1517
1491
fs . unlink ( socketPath , ( ) => {
1518
1492
server = net . createServer ( ) ;
1519
1493
server . listen ( socketPath ) ;
@@ -1613,8 +1587,7 @@ describe('app module', () => {
1613
1587
} ) ;
1614
1588
} ) ;
1615
1589
1616
- const dockDescribe = process . platform === 'darwin' ? describe : describe . skip ;
1617
- dockDescribe ( 'dock APIs' , ( ) => {
1590
+ ifdescribe ( process . platform === 'darwin' ) ( 'dock APIs' , ( ) => {
1618
1591
after ( async ( ) => {
1619
1592
await app . dock . show ( ) ;
1620
1593
} ) ;
0 commit comments