Skip to content

Commit 39bd429

Browse files
committed
partially revert last commit
1 parent 8faf097 commit 39bd429

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

addons/addon-image/test/ImageAddon.test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -163,43 +163,35 @@ test.describe('ImageAddon', () => {
163163
test('testdata default (scrolling with VT240 cursor pos)', async () => {
164164
const dim = await getDimensions();
165165
await ctx.proxy.write(SIXEL_SEQ_0);
166-
await timeout(50);
167166
deepStrictEqual(await getCursor(), [0, Math.floor(TESTDATA.height/dim.cellHeight)]);
168167
// moved to right by 10 cells
169168
await ctx.proxy.write('#'.repeat(10) + SIXEL_SEQ_0);
170-
await timeout(50);
171169
deepStrictEqual(await getCursor(), [10, Math.floor(TESTDATA.height/dim.cellHeight) * 2]);
172170
});
173171
test('write testdata noScrolling', async () => {
174172
await ctx.proxy.write('\x1b[?80h' + SIXEL_SEQ_0);
175-
await timeout(50);
176173
deepStrictEqual(await getCursor(), [0, 0]);
177174
// second draw does not change anything
178175
await ctx.proxy.write(SIXEL_SEQ_0);
179-
await timeout(50);
180176
deepStrictEqual(await getCursor(), [0, 0]);
181177
});
182178
test('testdata cursor always at VT240 pos', async () => {
183179
const dim = await getDimensions();
184180
// offset 0
185181
await ctx.proxy.write(SIXEL_SEQ_0);
186-
await timeout(50);
187182
deepStrictEqual(await getCursor(), [0, Math.floor(TESTDATA.height/dim.cellHeight)]);
188183
// moved to right by 10 cells
189184
await ctx.proxy.write('#'.repeat(10) + SIXEL_SEQ_0);
190-
await timeout(50);
191185
deepStrictEqual(await getCursor(), [10, Math.floor(TESTDATA.height/dim.cellHeight) * 2]);
192186
// moved by 30 cells (+10 prev)
193187
await ctx.proxy.write('#'.repeat(30) + SIXEL_SEQ_0);
194-
await timeout(50);
195188
deepStrictEqual(await getCursor(), [10 + 30, Math.floor(TESTDATA.height/dim.cellHeight) * 3]);
196189
});
197190
});
198191

199192
test.describe('image lifecycle & eviction', () => {
200193
test('delete image once scrolled off', async () => {
201194
await ctx.proxy.write(SIXEL_SEQ_0);
202-
await timeout(50);
203195
pollFor(ctx.page, 'window.imageAddon._storage._images.size', 1);
204196
// scroll to scrollback + rows - 1
205197
await ctx.page.evaluate(
@@ -216,7 +208,6 @@ test.describe('ImageAddon', () => {
216208
test('get storageUsage', async () => {
217209
strictEqual(await ctx.page.evaluate('window.imageAddon.storageUsage'), 0);
218210
await ctx.proxy.write(SIXEL_SEQ_0);
219-
await timeout(50);
220211
ok(Math.abs((await ctx.page.evaluate<number>('window.imageAddon.storageUsage')) - 640 * 80 * 4 / 1000000) < 0.05);
221212
});
222213
test('get/set storageLimit', async () => {
@@ -243,7 +234,6 @@ test.describe('ImageAddon', () => {
243234
});
244235
test('set storageLimit removes images synchronously', async () => {
245236
await ctx.proxy.write(SIXEL_SEQ_0 + SIXEL_SEQ_0 + SIXEL_SEQ_0);
246-
await timeout(100);
247237
const usage: number = await ctx.page.evaluate('window.imageAddon.storageUsage');
248238
const newUsage: number = await ctx.page.evaluate('window.imageAddon.storageLimit = 0.5; window.imageAddon.storageUsage');
249239
strictEqual(newUsage < usage, true);
@@ -252,7 +242,6 @@ test.describe('ImageAddon', () => {
252242
test('clear alternate images on buffer change', async () => {
253243
strictEqual(await ctx.page.evaluate('window.imageAddon.storageUsage'), 0);
254244
await ctx.proxy.write('\x1b[?1049h' + SIXEL_SEQ_0);
255-
await timeout(50);
256245
ok(Math.abs((await ctx.page.evaluate<number>('window.imageAddon.storageUsage')) - 640 * 80 * 4 / 1000000) < 0.05);
257246
await ctx.proxy.write('\x1b[?1049l');
258247
strictEqual(await ctx.page.evaluate('window.imageAddon.storageUsage'), 0);
@@ -286,27 +275,22 @@ test.describe('ImageAddon', () => {
286275
test.describe('IIP support - testimages', () => {
287276
test('palette.png', async () => {
288277
await ctx.proxy.write(TESTDATA_IIP[0][0]);
289-
await timeout(50);
290278
deepStrictEqual(await getOrigSize(1), TESTDATA_IIP[0][1]);
291279
});
292280
test('spinfox.png', async () => {
293281
await ctx.proxy.write(TESTDATA_IIP[1][0]);
294-
await timeout(50);
295282
deepStrictEqual(await getOrigSize(1), TESTDATA_IIP[1][1]);
296283
});
297284
test('w3c gif', async () => {
298285
await ctx.proxy.write(TESTDATA_IIP[2][0]);
299-
await timeout(50);
300286
deepStrictEqual(await getOrigSize(1), TESTDATA_IIP[2][1]);
301287
});
302288
test('w3c jpeg', async () => {
303289
await ctx.proxy.write(TESTDATA_IIP[3][0]);
304-
await timeout(50);
305290
deepStrictEqual(await getOrigSize(1), TESTDATA_IIP[3][1]);
306291
});
307292
test('w3c png', async () => {
308293
await ctx.proxy.write(TESTDATA_IIP[4][0]);
309-
await timeout(50);
310294
deepStrictEqual(await getOrigSize(1), TESTDATA_IIP[4][1]);
311295
});
312296
});

0 commit comments

Comments
 (0)