From eb105b234207eee72cafb146281ca90d46b40db3 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Sun, 1 Aug 2021 16:02:25 -0400 Subject: [PATCH] Fix browser tests by enabling SharedArrayBuffer --- test/karma-webworker.conf.js | 17 ++++++++++++++++- test/karma.conf.js | 16 +++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/test/karma-webworker.conf.js b/test/karma-webworker.conf.js index f0d509c97c..7afd2d03ab 100644 --- a/test/karma-webworker.conf.js +++ b/test/karma-webworker.conf.js @@ -81,7 +81,22 @@ module.exports = config => { autoWatch: true, browsers: ["ChromeHeadless"], - singleRun: true + singleRun: true, + + + // Allow SharedArrayBuffer: see https://web.dev/cross-origin-isolation-guide/ + customHeaders: [ + { + match: ".*", + name: "Cross-Origin-Opener-Policy", + value: "same-origin" + }, + { + match: ".*", + name: "Cross-Origin-Embedder-Policy", + value: "require-corp" + } + ] }; config.set(options); diff --git a/test/karma.conf.js b/test/karma.conf.js index 787ca312f2..a073f4d153 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -52,7 +52,21 @@ module.exports = config => { autoWatch: true, browsers: ["ChromeHeadless"], - singleRun: true + singleRun: true, + + // Allow SharedArrayBuffer: see https://web.dev/cross-origin-isolation-guide/ + customHeaders: [ + { + match: ".*", + name: "Cross-Origin-Opener-Policy", + value: "same-origin" + }, + { + match: ".*", + name: "Cross-Origin-Embedder-Policy", + value: "require-corp" + } + ] }; config.set(options);