From f9cee4db839bd3f40b388da29b754b7e2fedd8dc Mon Sep 17 00:00:00 2001 From: Matthias Kunnen Date: Fri, 14 Apr 2023 22:16:09 +0200 Subject: [PATCH] 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 --- .../test/bundling/image-directive/BUILD.bazel | 1 + .../e2e/image-distortion/image-distortion.ts | 3 +++ .../bundling/image-directive/e2e/white-607x3.png | Bin 0 -> 135 bytes 3 files changed, 4 insertions(+) create mode 100644 packages/core/test/bundling/image-directive/e2e/white-607x3.png diff --git a/packages/core/test/bundling/image-directive/BUILD.bazel b/packages/core/test/bundling/image-directive/BUILD.bazel index eac82493d48..dc763d50f72 100644 --- a/packages/core/test/bundling/image-directive/BUILD.bazel +++ b/packages/core/test/bundling/image-directive/BUILD.bazel @@ -44,6 +44,7 @@ http_server( "e2e/b.png", "e2e/logo-1500w.jpg", "e2e/logo-500w.jpg", + "e2e/white-607x3.png", "index.html", ], deps = [ diff --git a/packages/core/test/bundling/image-directive/e2e/image-distortion/image-distortion.ts b/packages/core/test/bundling/image-directive/e2e/image-distortion/image-distortion.ts index f5702a26114..a3226c00979 100644 --- a/packages/core/test/bundling/image-directive/e2e/image-distortion/image-distortion.ts +++ b/packages/core/test/bundling/image-directive/e2e/image-distortion/image-distortion.ts @@ -58,6 +58,9 @@ import {Component} from '@angular/core';
+ + +
`, }) export class ImageDistortionPassingComponent { diff --git a/packages/core/test/bundling/image-directive/e2e/white-607x3.png b/packages/core/test/bundling/image-directive/e2e/white-607x3.png new file mode 100644 index 0000000000000000000000000000000000000000..2627044e870b13fe38dc011f2784788c2aa42b60 GIT binary patch literal 135 zcmeAS@N?(olHy`uVBq!ia0y~yV2TH_nK_t%q!QoX_dtrXz$3Dlfk96hgc&QA+Lr+Z z*-JcqUD=Eaj?aro_3Lq-M$j>85A_CNplDN$kKh2?XXFf=5q fFff#}G#qDARA6TQ*7@EBsDr`N)z4*}Q$iB}6PqNt literal 0 HcmV?d00001