Skip to content

Commit a4aa9eb

Browse files
aduh95bengl
authored andcommitted
test: use global webcrypto for WPT tests
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>
1 parent 9af9083 commit a4aa9eb

File tree

1 file changed

+1
-40
lines changed

1 file changed

+1
-40
lines changed

test/wpt/test-webcrypto.js

Lines changed: 1 addition & 40 deletions
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)