Skip to content

Commit f48992f

Browse files
avivkellermarco-ippolito
authored andcommitted
test: remove unused common utilities
PR-URL: #54825 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
1 parent 0c1666a commit f48992f

File tree

5 files changed

+0
-170
lines changed

5 files changed

+0
-170
lines changed

test/common/README.md

-31
Original file line numberDiff line numberDiff line change
@@ -853,24 +853,6 @@ socket.write(frame.data);
853853

854854
The serialized `Buffer` may be retrieved using the `frame.data` property.
855855

856-
### Class: DataFrame extends Frame
857-
858-
The `http2.DataFrame` is a subclass of `http2.Frame` that serializes a `DATA`
859-
frame.
860-
861-
<!-- eslint-disable no-undef, node-core/require-common-first, node-core/required-modules -->
862-
863-
```js
864-
// id is the 32-bit stream identifier
865-
// payload is a Buffer containing the DATA payload
866-
// padlen is an 8-bit integer giving the number of padding bytes to include
867-
// final is a boolean indicating whether the End-of-stream flag should be set,
868-
// defaults to false.
869-
const frame = new http2.DataFrame(id, payload, padlen, final);
870-
871-
socket.write(frame.data);
872-
```
873-
874856
### Class: HeadersFrame
875857

876858
The `http2.HeadersFrame` is a subclass of `http2.Frame` that serializes a
@@ -1138,19 +1120,6 @@ are likely sufficient to hold a single file of `size` bytes. This is useful for
11381120
skipping tests that require hundreds of megabytes or even gigabytes of temporary
11391121
files, but it is inaccurate and susceptible to race conditions.
11401122

1141-
## UDP pair helper
1142-
1143-
The `common/udppair` module exports a function `makeUDPPair` and a class
1144-
`FakeUDPWrap`.
1145-
1146-
`FakeUDPWrap` emits `'send'` events when data is to be sent on it, and provides
1147-
an `emitReceived()` API for actin as if data has been received on it.
1148-
1149-
`makeUDPPair` returns an object `{ clientSide, serverSide }` where each side
1150-
is an `FakeUDPWrap` connected to the other side.
1151-
1152-
There is no difference between client or server side beyond their names.
1153-
11541123
## WPT module
11551124

11561125
### `harness`

test/common/crypto.js

-18
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,6 @@ const modp2buf = Buffer.from([
3333
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
3434
]);
3535

36-
function testDH({ publicKey: alicePublicKey, privateKey: alicePrivateKey },
37-
{ publicKey: bobPublicKey, privateKey: bobPrivateKey },
38-
expectedValue) {
39-
const buf1 = crypto.diffieHellman({
40-
privateKey: alicePrivateKey,
41-
publicKey: bobPublicKey,
42-
});
43-
const buf2 = crypto.diffieHellman({
44-
privateKey: bobPrivateKey,
45-
publicKey: alicePublicKey,
46-
});
47-
assert.deepStrictEqual(buf1, buf2);
48-
49-
if (expectedValue !== undefined)
50-
assert.deepStrictEqual(buf1, expectedValue);
51-
}
52-
5336
// Asserts that the size of the given key (in chars or bytes) is within 10% of
5437
// the expected size.
5538
function assertApproximateSize(key, expectedSize) {
@@ -117,7 +100,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
117100

118101
module.exports = {
119102
modp2buf,
120-
testDH,
121103
assertApproximateSize,
122104
testEncryptDecrypt,
123105
testSignVerify,

test/common/http2.js

-19
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,6 @@ class SettingsFrame extends Frame {
8181
}
8282
}
8383

84-
class DataFrame extends Frame {
85-
constructor(id, payload, padlen = 0, final = false) {
86-
let len = payload.length;
87-
let flags = 0;
88-
if (final) flags |= FLAG_EOS;
89-
const buffers = [payload];
90-
if (padlen > 0) {
91-
buffers.unshift(Buffer.from([padlen]));
92-
buffers.push(PADDING.slice(0, padlen));
93-
len += padlen + 1;
94-
flags |= FLAG_PADDED;
95-
}
96-
super(len, 0, flags, id);
97-
buffers.unshift(this[kFrameData]);
98-
this[kFrameData] = Buffer.concat(buffers);
99-
}
100-
}
101-
10284
class HeadersFrame extends Frame {
10385
constructor(id, payload, padlen = 0, final = false) {
10486
let len = payload.length;
@@ -138,7 +120,6 @@ class AltSvcFrame extends Frame {
138120
module.exports = {
139121
Frame,
140122
AltSvcFrame,
141-
DataFrame,
142123
HeadersFrame,
143124
SettingsFrame,
144125
PingFrame,

test/common/tick.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict';
2-
require('../common');
32

43
module.exports = function tick(x, cb) {
54
function ontick() {

test/common/udppair.js

-101
This file was deleted.

0 commit comments

Comments
 (0)