Skip to content

Commit e505b83

Browse files
aduh95danielleadams
authored andcommitted
test: use global webcrypto for WPT tests
PR-URL: #42236 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Mestery <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent d50edcc commit e505b83

File tree

1 file changed

+1
-40
lines changed

1 file changed

+1
-40
lines changed

test/wpt/test-webcrypto.js

+1-40
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,6 @@ const { WPTRunner } = require('../common/wpt');
99
const runner = new WPTRunner('WebCryptoAPI');
1010

1111
// Set Node.js flags required for the tests.
12-
runner.setFlags(['--expose-internals']);
13-
14-
// Set a script that will be executed in the worker before running the tests.
15-
runner.setInitScript(`
16-
const {
17-
Crypto,
18-
SubtleCrypto,
19-
crypto,
20-
} = require('internal/crypto/webcrypto');
21-
const { internalBinding } = require('internal/test/binding');
22-
const { DOMException } = internalBinding('messaging');
23-
global.DOMException = DOMException;
24-
25-
Object.defineProperties(global, {
26-
Crypto: {
27-
value: Crypto,
28-
configurable: true,
29-
writable: true,
30-
enumerable: false,
31-
},
32-
SubtleCrypto: {
33-
value: SubtleCrypto,
34-
configurable: true,
35-
writable: true,
36-
enumerable: false,
37-
},
38-
CryptoKey: {
39-
value: crypto.CryptoKey,
40-
configurable: true,
41-
writable: true,
42-
enumerable: false,
43-
},
44-
crypto: {
45-
value: crypto,
46-
configurable: true,
47-
writable: true,
48-
enumerable: false,
49-
},
50-
});
51-
`);
12+
runner.setFlags(['--experimental-global-webcrypto']);
5213

5314
runner.runJsTests();

0 commit comments

Comments
 (0)