diff --git a/src/mac.js b/src/mac.js index 7611ac28..a28ebf0e 100644 --- a/src/mac.js +++ b/src/mac.js @@ -162,6 +162,8 @@ class MacApp extends App { ] const possiblePlists = [ + [this.ehPlistFilename('Electron Helper (Renderer).app'), 'helperPlist'], + [this.ehPlistFilename('Electron Helper (Plugin).app'), 'helperPlist'], [this.ehPlistFilename('Electron Helper EH.app'), 'helperEHPlist'], [this.ehPlistFilename('Electron Helper NP.app'), 'helperNPPlist'], [this.helperPlistFilename(this.loginHelperPath), 'loginHelperPlist'] @@ -224,7 +226,7 @@ class MacApp extends App { } async moveHelpers () { - const helpers = [' Helper', ' Helper EH', ' Helper NP'] + const helpers = [' Helper', ' Helper EH', ' Helper NP', ' Helper (Renderer)', ' Helper (Plugin)'] await Promise.all(helpers.map(suffix => this.moveHelper(this.frameworksPath, suffix))) if (await fs.pathExists(this.loginItemsPath)) { await this.moveHelper(this.loginItemsPath, ' Login Helper') diff --git a/test/_setup.js b/test/_setup.js index c58e5b4d..8f1b1467 100644 --- a/test/_setup.js +++ b/test/_setup.js @@ -30,7 +30,14 @@ async function downloadAll (version) { const combinations = download.createDownloadCombos({ electronVersion: config.version, all: true }, targets.officialPlatforms, targets.officialArchs, skipDownloadingMacZips) await downloadElectronChecksum(version) - return Promise.all(combinations.map(combination => downloadElectronZip(version, combination))) + return Promise.all( + [ + ...combinations.map(combination => downloadElectronZip(version, combination)), + downloadElectronZip('6.0.0-beta.15', { + platform: 'darwin' + }) + ] + ) } async function downloadElectronChecksum (version) { diff --git a/test/darwin.js b/test/darwin.js index ba360a57..01ed5798 100644 --- a/test/darwin.js +++ b/test/darwin.js @@ -169,6 +169,27 @@ async function appHelpersBundleTest (t, opts, helperBundleId, appBundleId) { return assertCFBundleIdentifierValue(t, helperNPObj, helperBundleIdentifier + '.NP', 'CFBundleName should reflect opts.helperBundleId, opts.appBundleId or fallback to default in helper NP app') } +async function appHelpersBundleElectron6Test (t, opts) { + opts.electronVersion = '6.0.0-beta.15' + const defaultBundleName = `com.electron.${opts.name.toLowerCase()}` + const appBundleIdentifier = mac.filterCFBundleIdentifier(opts.appBundleId || defaultBundleName) + const helperBundleIdentifier = mac.filterCFBundleIdentifier(opts.helperBundleId || appBundleIdentifier + '.helper') + + const finalPath = (await packager(opts))[0] + const frameworksPath = path.join(finalPath, `${opts.name}.app`, 'Contents', 'Frameworks') + const helperObj = await util.parsePlist(t, path.join(frameworksPath, `${opts.name} Helper.app`)) + assertPlistStringValue(t, helperObj, 'CFBundleName', opts.name, 'CFBundleName should reflect opts.name in helper app') + assertCFBundleIdentifierValue(t, helperObj, helperBundleIdentifier, 'CFBundleIdentifier should reflect opts.helperBundleId, opts.appBundleId or fallback to default in helper app') + + const helperPluginObj = await util.parsePlist(t, path.join(frameworksPath, `${opts.name} Helper (Plugin).app`)) + assertPlistStringValue(t, helperPluginObj, 'CFBundleName', opts.name, 'CFBundleName should reflect opts.name in helper app') + assertCFBundleIdentifierValue(t, helperPluginObj, helperBundleIdentifier, 'CFBundleIdentifier should reflect opts.helperBundleId, opts.appBundleId or fallback to default in helper app') + + const helperRendererObj = await util.parsePlist(t, path.join(frameworksPath, `${opts.name} Helper (Renderer).app`)) + assertPlistStringValue(t, helperRendererObj, 'CFBundleName', opts.name, 'CFBundleName should reflect opts.name in helper app') + assertCFBundleIdentifierValue(t, helperRendererObj, helperBundleIdentifier, 'CFBundleIdentifier should reflect opts.helperBundleId, opts.appBundleId or fallback to default in helper app') +} + if (!(process.env.CI && process.platform === 'win32')) { test.serial('helper app paths', darwinTest(helperAppPathsTest)) test.serial('helper app paths test with app name needing sanitization', darwinTest(helperAppPathsTest, { name: '@username/package-name' }, '@username-package-name')) @@ -349,6 +370,8 @@ if (!(process.env.CI && process.platform === 'win32')) { test.serial('app helpers bundle helper-bundle-id fallback to app-bundle-id (w/ special characters)', darwinTest(appHelpersBundleTest, null, 'com.electron."bãśè tëßt!!@#$%^&*()?\'')) test.serial('app helpers bundle helper-bundle-id & app-bundle-id fallback', darwinTest(appHelpersBundleTest)) + test.serial('app helpers bundle with renderer/plugin helpers', darwinTest(appHelpersBundleElectron6Test)) + test.serial('EH/NP helpers do not exist', darwinTest(async (t, baseOpts) => { const helpers = [ 'Helper EH',