Repository navigation
Expand file tree
/
Copy pathtests.html
More file actions
401 lines (350 loc) · 24.1 KB
/
Copy pathtests.html
File metadata and controls
401 lines (350 loc) · 24.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Unit Tests</title>
</head>
<body>
<h1>Running Unit Tests... Check Console</h1>
<script src="frame_assembler.js"></script>
<script src="simulated_frame_transport.js"></script>
<script src="ltr_reference_controller.js"></script>
<script src="simple_rate_controller.js"></script>
<script src="encoded_frame.js"></script>
<script src="frame_metadata_store.js"></script>
<script>
// Basic Assertion Utility
const assert = {
_testCount: 0,
_failCount: 0,
_results: [],
_logResult: function(isSuccess, message) {
this._testCount++;
const result = {
test: message,
status: isSuccess ? 'PASS' : 'FAIL',
};
this._results.push(result);
if (isSuccess) {
console.log(`%cPASS: ${message}`, 'color: green');
} else {
this._failCount++;
console.error(`%cFAIL: ${message}`, 'color: red');
}
},
strictEqual: function(actual, expected, message) {
const isSuccess = (actual === expected);
this._logResult(isSuccess, message + ` (Expected: ${expected}, Got: ${actual})`);
},
deepStrictEqual: function(actual, expected, message) {
const isSuccess = JSON.stringify(actual) === JSON.stringify(expected);
this._logResult(isSuccess, message + ` (Expected: ${JSON.stringify(expected)}, Got: ${JSON.stringify(actual)})`);
},
isTrue: function(condition, message) {
this._logResult(condition, message);
},
isFalse: function(condition, message) {
this._logResult(!condition, message);
},
summary: function() {
const summary = {
total: this._testCount,
passed: this._testCount - this._failCount,
failed: this._failCount,
results: this._results
};
console.log('\n--- Test Summary ---');
if (this._failCount === 0) {
console.log(`%cAll ${this._testCount} tests passed!`, 'color: green; font-weight: bold;');
} else {
console.error(`%c${this._failCount} of ${this._testCount} tests failed.`, 'color: red; font-weight: bold;');
}
console.log('--- JSON Test Results ---');
console.log(JSON.stringify(summary, null, 2));
const heading = document.querySelector('h1');
if (heading) {
heading.textContent = this._failCount === 0
? `All ${this._testCount} unit tests passed!`
: `${this._failCount} of ${this._testCount} unit tests failed.`;
}
return this._failCount === 0;
}
};
// --- Unit Tests for FrameAssembler ---
function runFrameAssemblerTests() {
console.log('\n--- Running FrameAssembler Tests ---');
let decodedFrames = [];
const onReadyToRenderCallback = (encodedFrame) => {
decodedFrames.push(encodedFrame.frameId);
};
const assembler = new FrameAssembler(onReadyToRenderCallback);
// Mock EncodedVideoChunk for testing
const createMockEncodedChunk = (type, timestamp) => ({
type: type,
timestamp: timestamp,
byteLength: 100, // Dummy value
data: new ArrayBuffer(100) // Dummy data
});
// Test Case 1: Keyframe should be decoded immediately
decodedFrames = [];
assembler.reset();
assembler.decoderNeedsKeyFrame = true; // Simulate decoder needing a keyframe
const keyFrame1 = new EncodedFrame(createMockEncodedChunk('key', 1000), 1, [], 1000);
assembler.OnFrameReceived(keyFrame1);
assert.deepStrictEqual(decodedFrames, [1], 'Keyframe 1 should be decoded immediately');
assert.isFalse(assembler.decoderNeedsKeyFrame, 'decoderNeedsKeyFrame should be false after keyframe');
assert.strictEqual(assembler.bufferedFrames.size, 0, 'Buffered frames should be empty');
// Test Case 2: Delta frame before keyframe should be buffered
decodedFrames = [];
assembler.reset();
assembler.decoderNeedsKeyFrame = true;
const deltaFrame1 = new EncodedFrame(createMockEncodedChunk('delta', 2000), 2, [1], 2000);
assembler.OnFrameReceived(deltaFrame1);
assert.deepStrictEqual(decodedFrames, [], 'Delta frame 1 should be buffered');
assert.strictEqual(assembler.bufferedFrames.size, 1, 'Buffered frames should contain 1 frame');
assert.isTrue(assembler.decoderNeedsKeyFrame, 'decoderNeedsKeyFrame should still be true');
// Test Case 3: Keyframe after buffered delta frame should decode both
decodedFrames = [];
assembler.reset();
assembler.decoderNeedsKeyFrame = true;
const deltaFrame2 = new EncodedFrame(createMockEncodedChunk('delta', 2000), 2, [1], 2000);
const deltaFrame3 = new EncodedFrame(createMockEncodedChunk('delta', 3000), 3, [2], 3000);
assembler.OnFrameReceived(deltaFrame2);
assembler.OnFrameReceived(deltaFrame3);
assert.strictEqual(assembler.bufferedFrames.size, 2, 'Buffered frames should contain 2 frames');
assert.deepStrictEqual(decodedFrames, [], 'No frames decoded yet');
const keyFrame2 = new EncodedFrame(createMockEncodedChunk('key', 1000), 1, [], 1000);
assembler.OnFrameReceived(keyFrame2);
// Expect keyFrame2 (ID 1), then deltaFrame2 (ID 2), then deltaFrame3 (ID 3)
assert.deepStrictEqual(decodedFrames, [1, 2, 3], 'Keyframe 2 should decode itself and buffered frames');
assert.strictEqual(assembler.bufferedFrames.size, 0, 'Buffered frames should be empty after decoding');
assert.isFalse(assembler.decoderNeedsKeyFrame, 'decoderNeedsKeyFrame should be false after keyframe');
// Test Case 4: Frames arriving out of order but dependencies met
decodedFrames = [];
assembler.reset();
assembler.decoderNeedsKeyFrame = false; // Assume decoder is already initialized
const frameA = new EncodedFrame(createMockEncodedChunk('delta', 2000), 2, [1], 2000);
const frameB = new EncodedFrame(createMockEncodedChunk('delta', 3000), 3, [1, 2], 3000);
const frameC = new EncodedFrame(createMockEncodedChunk('delta', 4000), 4, [3], 4000);
const frame1 = new EncodedFrame(createMockEncodedChunk('key', 1000), 1, [], 1000);
assembler.OnFrameReceived(frameA); // Buffered
assembler.OnFrameReceived(frameC); // Buffered
assembler.OnFrameReceived(frameB); // Buffered
assert.deepStrictEqual(decodedFrames, [], 'No frames decoded yet');
assert.strictEqual(assembler.bufferedFrames.size, 3, 'All frames buffered');
assembler.OnFrameReceived(frame1); // Keyframe, should trigger decoding of A, B, C
assert.deepStrictEqual(decodedFrames, [1, 2, 3, 4], 'All frames should be decoded in order');
assert.strictEqual(assembler.bufferedFrames.size, 0, 'Buffered frames should be empty');
// Test Case 5: _clearOldState functionality
decodedFrames = [];
assembler.reset();
assembler.decoderNeedsKeyFrame = true;
const oldFrame = new EncodedFrame(createMockEncodedChunk('delta', 100), 1, [], 100);
const currentFrame = new EncodedFrame(createMockEncodedChunk('key', 1000), 2, [], 1000);
assembler.OnFrameReceived(oldFrame); // Should be buffered
assert.strictEqual(assembler.bufferedFrames.size, 1, 'Old frame should be buffered');
assembler.OnFrameReceived(currentFrame); // Should decode and clear oldFrame
assert.deepStrictEqual(decodedFrames, [2], 'Only current keyframe should be decoded');
assert.strictEqual(assembler.bufferedFrames.size, 0, 'Old buffered frame should be cleared');
// Test Case 6: Reset functionality
assembler.reset();
assert.strictEqual(assembler.decodedFrames.size, 0, 'Decoded frames should be empty after reset');
assert.strictEqual(assembler.bufferedFrames.size, 0, 'Buffered frames should be empty after reset');
assert.isFalse(assembler.decoderNeedsKeyFrame, 'decoderNeedsKeyFrame should be false after reset');
}
// --- Unit Tests for SimpleRateController ---
function runSimpleRateControllerTests() {
console.log('\n--- Running SimpleRateController Tests ---');
const baseTime = 10000; // Fake start time
let result; // Declare result here
// Test Case 1: Constructor and initial state
let now = baseTime;
let controller = new SimpleRateController('avc', 10, 50, 1000000, 30, now, 500, 70, 0.5, 0.1, 95, 20, 20, 2);
assert.strictEqual(controller.codecType, 'avc', 'Constructor should set codecType');
assert.strictEqual(controller.minQp, 10, 'Constructor should set minQp');
assert.strictEqual(controller.maxQp, 50, 'Constructor should set maxQp');
assert.strictEqual(controller.targetBitrate, 1000000, 'Constructor should set targetBitrate');
assert.strictEqual(controller.framerate, 30, 'Constructor should set framerate');
assert.strictEqual(controller.maxBufferLevelMs, 500, 'Constructor should set maxBufferLevelMs');
assert.strictEqual(controller.targetFullnessPercent, 70, 'Constructor should set targetFullnessPercent');
assert.strictEqual(controller.alpha, 0.5, 'Constructor should set alpha');
assert.strictEqual(controller.Kp_buffer, 0.1, 'Constructor should set Kp_buffer');
assert.strictEqual(controller.frameDropThresholdPercent, 95, 'Constructor should set default frameDropThresholdPercent');
assert.strictEqual(controller.reencodeOvershootPercent, 20, 'Constructor should set default reencodeOvershootPercent');
assert.strictEqual(controller.reencodeUndershootPercent, 20, 'Constructor should set default reencodeUndershootPercent');
assert.strictEqual(controller.maxReencodeCount, 2, 'Constructor should set default maxReencodeCount');
assert.isTrue(controller._qpDiffToSizeRatioMap instanceof Map, 'QP to Size Ratio map should be a Map');
// Test Case 2: _qpChangeFromSizeRatioChange()
assert.strictEqual(controller._qpChangeFromSizeRatioChange(1), 0, '_qpChangeFromSizeRatioChange(1) should be 0');
assert.isTrue(controller._qpChangeFromSizeRatioChange(0.5) > 0, '_qpChangeFromSizeRatioChange(0.5) should be positive');
assert.isTrue(controller._qpChangeFromSizeRatioChange(2.0) < 0, '_qpChangeFromSizeRatioChange(2.0) should be negative');
// Test Case 3: OnEncodedFrame() - Basic update
now = baseTime + 1000;
controller = new SimpleRateController('avc', 10, 50, 1000000, 30, now, 500, 70, 0.5, 0.1);
controller.avgQp = 30; // Reset avgQp
const frameTime1 = now + 1;
const targetFrameSizeBytes = Math.floor((controller.targetBitrate / controller.framerate) / 8);
let currentQp = controller.GetNextQp(frameTime1, false);
// Adjust frameSize1 to be slightly larger than target to avoid undershoot
const frameSize1 = targetFrameSizeBytes * 1.1;
result = controller.OnEncodedFrame(frameTime1, frameSize1, currentQp, false);
if (!result.reencode) {
assert.isTrue(controller.bitDebt > 0, 'Buffer debt should update after first frame');
assert.strictEqual(controller.lastUpdateTime, frameTime1, 'Last update time should change');
const frameTime2 = now + 34;
const frameSize2 = targetFrameSizeBytes * 0.9;
currentQp = controller.GetNextQp(frameTime2, false);
result = controller.OnEncodedFrame(frameTime2, frameSize2, currentQp, false);
if (!result.reencode) {
assert.isTrue(controller.lastUpdateTime === frameTime2, 'Last update time should update again');
}
}
// Test Case 4: GetNextQp() - Normal operation
now = baseTime + 2000;
controller = new SimpleRateController('avc', 10, 50, 1000000, 30, now, 500, 70, 0.5, 0.1);
controller.avgQp = 30; // Reset avgQp
controller.bitDebt = controller.targetBufferLevelBits;
const qpTarget = controller.GetNextQp(now + 1, false);
assert.isTrue(qpTarget >= 10 && qpTarget <= 50, 'GetNextQp should return QP in range');
// Test Case 9: SetRates()
now = baseTime + 3000;
controller = new SimpleRateController('avc', 10, 50, 1000000, 30, now, 500, 70, 0.5, 0.1);
controller.SetRates(2000000, 60, 1000, 80, now + 1, 0.6, 0.2, 92, 25, 15, 3);
assert.strictEqual(controller.targetBitrate, 2000000, 'SetRates should update targetBitrate');
assert.strictEqual(controller.framerate, 60, 'SetRates should update framerate');
assert.strictEqual(controller.maxBufferLevelMs, 1000, 'SetRates should update maxBufferLevelMs');
assert.strictEqual(controller.targetFullnessPercent, 80, 'SetRates should update targetFullnessPercent');
assert.strictEqual(controller.alpha, 0.6, 'SetRates should update alpha');
assert.strictEqual(controller.Kp_buffer, 0.2, 'SetRates should update Kp_buffer');
assert.strictEqual(controller.frameDropThresholdPercent, 92, 'SetRates should update frameDropThresholdPercent');
assert.strictEqual(controller.reencodeOvershootPercent, 25, 'SetRates should update reencodeOvershootPercent');
assert.strictEqual(controller.reencodeUndershootPercent, 15, 'SetRates should update reencodeUndershootPercent');
assert.strictEqual(controller.maxReencodeCount, 3, 'SetRates should update maxReencodeCount');
assert.strictEqual(controller.lastUpdateTime, now + 1, 'SetRates should update lastUpdateTime');
// Test Case 10: Frame Drop
now = baseTime + 4000;
controller = new SimpleRateController('avc', 10, 50, 1000000, 30, now, 500, 70, 0.5, 0.1, 90, 20, 20, 2);
controller.bitDebt = controller.maxBufferLevelBits * 0.91; // Above drop threshold
let nextQp = controller.GetNextQp(now + 1, false);
assert.strictEqual(nextQp, -1, 'GetNextQp should return -1 to signal frame drop');
assert.strictEqual(controller.reEncodeContext.count, 0, 'Reencode count should remain 0 after frame drop');
// Test Cases 11-13: Re-encode Logic (Overshoot)
now = baseTime + 5000;
const targetFullness = 70;
const overshoot = 20;
controller = new SimpleRateController('avc', 10, 50, 1000000, 30, now, 500, targetFullness, 0.5, 0.1, 95, overshoot, 20, 2);
controller.avgQp = 30; // Reset avgQp
const bitsPerFrame = controller.targetBitrate / controller.framerate;
// Set bitDebt to the target to start from a neutral point
controller.bitDebt = controller.targetBufferLevelBits;
// Test Case 11: Re-encode Trigger on Overshoot
nextQp = controller.GetNextQp(now + 1, false); // Still call to set targetSize
const initialQp = 30; // Force mid-range QP
assert.isTrue(initialQp >= 10 && initialQp <= 50, 'GetNextQp should return a valid QP');
// This frame size will push the potential buffer level over targetFullness + overshoot
const largeFrameSizeBytes = Math.floor(((controller.maxBufferLevelBits * (targetFullness + overshoot + 15)) / 100 - controller.bitDebt) / 8);
result = controller.OnEncodedFrame(now + 34, largeFrameSizeBytes, initialQp, false);
assert.isTrue(result.reencode, 'OnEncodedFrame should signal reencode for overshoot');
assert.strictEqual(controller.reEncodeContext.count, 1, 'Reencode count should be incremented');
assert.isTrue(result.qp > initialQp, 'Reencode should suggest a higher QP for overshoot');
// Test Case 12: Re-encode Second Attempt
const secondQp = result.qp;
result = controller.OnEncodedFrame(now + 34, largeFrameSizeBytes, secondQp, false); // Same timestamp
assert.isTrue(result.reencode, 'OnEncodedFrame should signal reencode again');
assert.strictEqual(controller.reEncodeContext.count, 2, 'Reencode count should be 2');
assert.isTrue(result.qp > secondQp, 'Reencode should suggest an even higher QP');
// Test Case 13: Re-encode Max Attempts Reached
const thirdQp = result.qp;
result = controller.OnEncodedFrame(now + 34, largeFrameSizeBytes, thirdQp, false); // Same timestamp
assert.isFalse(result.reencode, 'OnEncodedFrame should not signal reencode after max attempts');
assert.strictEqual(controller.reEncodeContext.count, 0, 'Reencode count should be reset');
const finalFullness = (controller.bitDebt / controller.maxBufferLevelBits) * 100;
assert.isTrue(finalFullness > targetFullness + overshoot, 'Bit debt should be updated after max reencode attempts');
// Test Case 14: Re-encode Not Triggered (Frame within bounds)
now = baseTime + 6000;
controller = new SimpleRateController('avc', 10, 50, 1000000, 30, now, 500, 70, 0.5, 0.1, 90, 20, 20, 2);
controller.avgQp = 30; // Reset avgQp
controller.bitDebt = controller.targetBufferLevelBits;
nextQp = controller.GetNextQp(now + 1, false);
const normalFrameSizeBytes = Math.floor((controller.targetBitrate / controller.framerate) / 8);
result = controller.OnEncodedFrame(now + 1, normalFrameSizeBytes, nextQp, false);
assert.isFalse(result.reencode, 'OnEncodedFrame should not signal reencode for a normal frame');
assert.strictEqual(controller.reEncodeContext.count, 0, 'Reencode count should be 0');
// Test Case 15: Re-encode Trigger on Undershoot
now = baseTime + 7000;
const undershoot = 20;
controller = new SimpleRateController('avc', 10, 50, 1000000, 30, now, 500, targetFullness, 0.5, 0.1, 95, 20, undershoot, 2);
controller.avgQp = 30; // Reset avgQp
controller.bitDebt = controller.targetBufferLevelBits;
nextQp = controller.GetNextQp(now + 1, false); // Call to set targetSize
const undershootQp = 30; // Force mid-range QP
// This frame size will push the potential buffer level below targetFullness - undershoot
const smallFrameSizeBytes = Math.floor(((controller.maxBufferLevelBits * Math.max(0, targetFullness - undershoot - 50)) / 100 - controller.bitDebt) / 8);
result = controller.OnEncodedFrame(now + 1, smallFrameSizeBytes, undershootQp, false);
assert.isTrue(result.reencode, 'OnEncodedFrame should signal reencode for undershoot');
assert.strictEqual(controller.reEncodeContext.count, 1, 'Reencode count should be incremented for undershoot');
assert.isTrue(result.qp < undershootQp, 'Reencode should suggest a lower QP for undershoot');
}
// --- Unit Tests for LtrReferenceController & LTR FrameAssembler behavior ---
function runLtrTests() {
console.log('\n--- Running LtrReferenceController & LTR Assembler Tests ---');
const buf0 = { id: 'buf0' };
const buf1 = { id: 'buf1' };
const buf2 = { id: 'buf2' };
const ltr = new LtrReferenceController([buf0, buf1, buf2]);
// Keyframe populates buffer 0 and has no references
const kf = ltr.GetNextEncodeOptions(true, 1);
assert.strictEqual(kf.encodeOptions.keyFrame, true, 'Keyframe option should be true');
assert.strictEqual(kf.encodeOptions.updateBuffer, buf0, 'Keyframe should update buffer 0');
assert.deepStrictEqual(kf.referenceFrameIds, [], 'Keyframe should have empty referenceFrameIds');
// Next delta marks buffer 1 as pending LTR while referencing frame 1
const d2 = ltr.GetNextEncodeOptions(false, 2);
assert.isTrue(d2.isLtr, 'First delta after keyframe should be marked LTR');
assert.strictEqual(d2.encodeOptions.updateBuffer, buf1, 'Pending LTR should update buffer 1');
assert.deepStrictEqual(d2.referenceFrameIds, [1], 'Delta 2 should reference frame 1');
// While frame 2 ACK is in flight, delta 3 is non-LTR and still references frame 1
const d3 = ltr.GetNextEncodeOptions(false, 3);
assert.isFalse(d3.isLtr, 'Delta while LTR pending should not be marked LTR');
assert.strictEqual(d3.encodeOptions.updateBuffer, undefined, 'Non-LTR frame should not update a buffer');
assert.deepStrictEqual(d3.referenceFrameIds, [1], 'Delta 3 should still reference frame 1');
// Receiving ACK for frame 2 promotes buffer 1 to good and frees buffer 0
ltr.OnReceivedLtrAck(2);
assert.deepStrictEqual(ltr.GetLastGoodFrameIds(), [2], 'After ACK, frame 2 should be the active good LTR');
const d4 = ltr.GetNextEncodeOptions(false, 4);
assert.isTrue(d4.isLtr, 'After ACK, next delta should start a new LTR in buffer 0');
assert.strictEqual(d4.encodeOptions.updateBuffer, buf0, 'New LTR should reuse buffer 0');
assert.deepStrictEqual(d4.referenceFrameIds, [2], 'Delta 4 should reference ACKed frame 2');
// Forced keyframe resets pending LTR; late pre-keyframe ACK for frame 4 must be ignored
ltr.GetNextEncodeOptions(true, 5);
ltr.OnReceivedLtrAck(4);
assert.deepStrictEqual(ltr.GetLastGoodFrameIds(), [5], 'Stale pre-keyframe ACK must not overwrite keyframe LTR');
// FrameAssembler: intra-GOP retransmitted LTR is decoded, pre-keyframe retransmitted LTR is dropped
const decoded = [];
const assembler = new FrameAssembler((f) => decoded.push(f.frameId));
const chunk = (type, ts) => ({ type, timestamp: ts, byteLength: 100 });
assembler.OnFrameReceived(new EncodedFrame(chunk('key', 100), 1, [], 100, false));
assembler.OnFrameReceived(new EncodedFrame(chunk('delta', 300), 3, [1], 300, false));
assembler.OnFrameReceived(new EncodedFrame(chunk('delta', 200), 2, [1], 200, true)); // late intra-GOP LTR
assert.deepStrictEqual(decoded, [1, 3, 2], 'Late intra-GOP LTR frame should still be decoded');
assembler.OnFrameReceived(new EncodedFrame(chunk('key', 500), 5, [], 500, false));
assembler.OnFrameReceived(new EncodedFrame(chunk('delta', 400), 4, [2], 400, true)); // stale pre-KF LTR
assert.deepStrictEqual(decoded, [1, 3, 2, 5], 'Pre-keyframe LTR frame must be discarded after keyframe');
// FrameMetadataStore pruneOldMetadata
const store = new FrameMetadataStore();
store.addFrameMetadata(100, { frameId: 1 });
store.addFrameMetadata(200, { frameId: 2 });
store.pruneOldMetadata(200);
assert.strictEqual(store.getFrameMetadata(100), undefined, 'Older metadata should be pruned');
assert.strictEqual(store.getFrameMetadata(200).frameId, 2, 'Current metadata should be retained');
}
// Run all tests
window.onload = () => {
runFrameAssemblerTests();
runSimpleRateControllerTests();
runLtrTests();
assert.summary();
};
</script>
</body>
</html>