Skip to content

Commit ef36497

Browse files
danilsomsikovDevtools-frontend LUCI CQ
authored andcommitted
Fix the resize test
The reason for flakniess was that test elements were cropped by the page. Originally they were both 300px high, but due to the cropping, the second had visible height of 80px. Resizing it to 100px didn't pass the reporting threshold at 50px. Bug: 347520196 Change-Id: Ic27707259868138899c3bfbd1101aecf47987122 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5938189 Auto-Submit: Danil Somsikov <[email protected]> Commit-Queue: Danil Somsikov <[email protected]> Commit-Queue: Alex Rudenko <[email protected]> Reviewed-by: Alex Rudenko <[email protected]>
1 parent 279239c commit ef36497

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

front_end/ui/visual_logging/LoggingDriver.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,7 @@ describe('LoggingDriver', () => {
678678
assert.deepStrictEqual(recordResize.firstCall.firstArg, {veid: getVeId(element), width: 300, height: 300});
679679
});
680680

681-
// Flaky, to be rewritten
682-
it.skip('[crbug.com/347520196] throttles resize per element', async () => {
681+
it('throttles resize per element', async () => {
683682
addLoggableElements();
684683
const element1 = document.getElementById('element') as HTMLElement;
685684
const element2 = element1.cloneNode() as HTMLElement;
@@ -694,16 +693,16 @@ describe('LoggingDriver', () => {
694693
await expectCall(throttle, {callCount: 2});
695694
element2.style.height = '200px';
696695
await expectCall(throttle, {callCount: 2});
697-
element1.style.height = '100px';
696+
element1.style.height = '10px';
698697
await expectCall(throttle, {callCount: 2});
699-
element2.style.height = '100px';
698+
element2.style.height = '10px';
700699
const [work] = await expectCall(throttle, {callCount: 2});
701700

702701
assert.isFalse(recordResize.called);
703702
await work();
704703
assert.isTrue(recordResize.calledTwice);
705-
assert.strictEqual(recordResize.firstCall.firstArg.height, 100);
706-
assert.strictEqual(recordResize.lastCall.firstArg.height, 100);
704+
assert.strictEqual(recordResize.firstCall.firstArg.height, 10);
705+
assert.strictEqual(recordResize.lastCall.firstArg.height, 10);
707706
assert.notStrictEqual(recordResize.firstCall.firstArg.veid, recordResize.lastCall.firstArg.veid);
708707
});
709708

0 commit comments

Comments
 (0)