mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-11-23 22:15:52 +00:00
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 .
This commit is contained in:
parent
2bbe3fcbbc
commit
3465a360ad
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user