From 3465a360adc4e7b3d8ddb1f6d2d0c3b83236ad7f Mon Sep 17 00:00:00 2001 From: larabr <7375870+larabr@users.noreply.github.com> Date: Mon, 13 Oct 2025 16:21:25 +0200 Subject: [PATCH] Tests: fix WebCrypto parallelism expectation for Chrome v141+ Chromium disabled some async WebCrypto operations in v141 . Context: https://github.com/w3c/webcrypto/issues/389#issuecomment-3136298597 . --- test/general/packet.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/general/packet.js b/test/general/packet.js index c998ef4a..a4087dc0 100644 --- a/test/general/packet.js +++ b/test/general/packet.js @@ -243,8 +243,12 @@ export default () => describe('Packet', function() { cryptCallsActive--; } }); + + const isChromeV141OrAbove = () => typeof window !== 'undefined' && window.navigator.userAgent.match(/Chrome/) && /Chrome\/([0-9.]+)/.exec(navigator.userAgent)[1].split('.')[0] >= 141; cryptStub.onCall(1).callsFake(function() { - expect(cryptCallsActive).to.equal(1); + // Chromium disabled some async WebCrypto operations in v141 . + // Context: https://github.com/w3c/webcrypto/issues/389#issuecomment-3136298597 . + expect(cryptCallsActive).to.equal(isChromeV141OrAbove() ? 0 : 1); return crypt.apply(this, arguments); }); cryptStub.callThrough();