test(common): test rounding problems in image distortion detection (#49889)

Due to assertNoImageDistortion using clientWidth and clientHeight, and these properties returning integers, rounding errors occur that exceed the aspect ratio tolerance.
Increasing the tolerance could hide actual distortion so correcting the calculation to use floats would be best and could even allow for a lower tolerance.

PR Close #49889
This commit is contained in:
Matthias Kunnen 2023-04-14 22:16:09 +02:00 committed by Pawel Kozlowski
parent 857cf7ea23
commit f9cee4db83
3 changed files with 4 additions and 0 deletions

View file

@ -44,6 +44,7 @@ http_server(
"e2e/b.png",
"e2e/logo-1500w.jpg",
"e2e/logo-500w.jpg",
"e2e/white-607x3.png",
"index.html",
],
deps = [

View file

@ -58,6 +58,9 @@ import {Component} from '@angular/core';
<img ngSrc="/e2e/a.png" width="25" height="25" style="padding: 1px 2px 5px 10px; box-sizing: content-box; height: 25px; width: auto">
<img ngSrc="/e2e/a.png" width="25" height="25" style="padding: 1px 2px 5px 10px; box-sizing: border-box; height: 25px; width: auto">
<br>
<!-- autoscale with large difference between width and height resulting in rounding -->
<img ngSrc="/e2e/white-607x3.png" width="607" height="3" style="width: auto; height: 2px">
<br>
`,
})
export class ImageDistortionPassingComponent {

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B