Skip to content

Commit

Permalink
test: use global webcrypto for WPT tests
Browse files Browse the repository at this point in the history
PR-URL: #42236
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
aduh95 authored and danielleadams committed Apr 24, 2022
1 parent 9ef096f commit 723e1e1
Showing 1 changed file with 1 addition and 40 deletions.
41 changes: 1 addition & 40 deletions test/wpt/test-webcrypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,6 @@ const { WPTRunner } = require('../common/wpt');
const runner = new WPTRunner('WebCryptoAPI');

// Set Node.js flags required for the tests.
runner.setFlags(['--expose-internals']);

// Set a script that will be executed in the worker before running the tests.
runner.setInitScript(`
const {
Crypto,
SubtleCrypto,
crypto,
} = require('internal/crypto/webcrypto');
const { internalBinding } = require('internal/test/binding');
const { DOMException } = internalBinding('messaging');
global.DOMException = DOMException;
Object.defineProperties(global, {
Crypto: {
value: Crypto,
configurable: true,
writable: true,
enumerable: false,
},
SubtleCrypto: {
value: SubtleCrypto,
configurable: true,
writable: true,
enumerable: false,
},
CryptoKey: {
value: crypto.CryptoKey,
configurable: true,
writable: true,
enumerable: false,
},
crypto: {
value: crypto,
configurable: true,
writable: true,
enumerable: false,
},
});
`);
runner.setFlags(['--experimental-global-webcrypto']);

runner.runJsTests();

0 comments on commit 723e1e1

Please sign in to comment.