Browse Source

feat: add ELECTRON_DISABLE_SANDBOX env var (#16662)

trop[bot] 6 years ago
parent
commit
9a68ce87eb
2 changed files with 9 additions and 0 deletions
  1. 3 0
      atom/app/atom_main_delegate.cc
  2. 6 0
      vsts-arm-test-steps.yml

+ 3 - 0
atom/app/atom_main_delegate.cc

@@ -164,6 +164,9 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
   if (env->HasVar("ELECTRON_ENABLE_STACK_DUMPING"))
     base::debug::EnableInProcessStackDumping();
 
+  if (env->HasVar("ELECTRON_DISABLE_SANDBOX"))
+    command_line->AppendSwitch(service_manager::switches::kNoSandbox);
+
   chrome::RegisterPathProvider();
 
 #if defined(OS_MACOSX)

+ 6 - 0
vsts-arm-test-steps.yml

@@ -70,18 +70,24 @@ steps:
     python electron/script/verify-ffmpeg.py --source-root "$PWD" --build-dir out/Default --ffmpeg-path out/ffmpeg
   displayName: Verify non proprietary ffmpeg
   timeoutInMinutes: 5
+  env:
+    ELECTRON_DISABLE_SANDBOX: 1
 
 - bash: |
     cd src
     python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default
   displayName: Verify mksnapshot
   timeoutInMinutes: 5
+  env:
+    ELECTRON_DISABLE_SANDBOX: 1
 
 - bash: |
    cd src
    ./out/Default/electron electron/spec --ci
   displayName: 'Run Electron tests'
   timeoutInMinutes: 10
+  env:
+    ELECTRON_DISABLE_SANDBOX: 1
 
 - task: PublishTestResults@2
   displayName: 'Publish Test Results'