Skip to content

Commit

Permalink
test: Don't run sandbox tests on Linux for Electron < 13 (#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish authored Jan 11, 2023
1 parent 6ad9d70 commit 49760e2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/electron-forge-webpack/recipe.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: Electron Forge Webpack with contextIsolation and sandbox
command: yarn && yarn package
condition: supportsContextIsolation
condition: supportsContextIsolation && supportsSandbox
timeout: 120
2 changes: 1 addition & 1 deletion examples/webpack-context-isolation-preload/recipe.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: Webpack 5 app with contextIsolation and sandbox with preload
command: yarn && yarn build
condition: supportsContextIsolation
condition: supportsContextIsolation && supportsSandbox
timeout: 120
2 changes: 1 addition & 1 deletion examples/webpack-context-isolation/recipe.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: Webpack 5 app with contextIsolation and sandbox
command: yarn && yarn build
condition: supportsContextIsolation
condition: supportsContextIsolation && supportsSandbox
timeout: 120
4 changes: 3 additions & 1 deletion test/e2e/recipe/eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ function getEvalContext(electronVersion: string): Context {
(platform === 'win32' && version.major >= 6) ||
(platform === 'linux' && version.major >= 15);

const supportsSandbox = platform !== 'linux' || version.major >= 13;

const supportsContextIsolation = version.major >= 6;

return createContext({ version, platform, usesCrashpad, supportsContextIsolation });
return createContext({ version, platform, usesCrashpad, supportsContextIsolation, supportsSandbox });
}

export function evaluateCondition(name: string, electronVersion: string, condition: string | undefined): boolean {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/test-apps/other/error-iframe/recipe.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: JavaScript Error from <iframe>
command: yarn && yarn build
condition: supportsContextIsolation
condition: supportsContextIsolation && supportsSandbox
timeout: 120

0 comments on commit 49760e2

Please sign in to comment.