From b735a9bb25f124b8db6ab167dc80e76bf4f68082 Mon Sep 17 00:00:00 2001 From: Glen Robertson Date: Thu, 28 Oct 2021 10:30:22 +0000 Subject: [PATCH] Bug 1738180 [wpt PR 31412] - Revert "Reland "[LCP] Add animated image support"", a=testonly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic update from web-platform-tests Revert "Reland "[LCP] Add animated image support"" This reverts commit 2ebdf0d26ea55271942e6b5ed585a08016a3e80b. Reason for revert: Still appears to be causing flakiness on PageLoadMetricsBrowserTestWithAnimatedLCPFlag.PageLCPNonAnimatedImage Flakiness stopped while this was reverted and resumed when it relanded. https://screenshot.googleplex.com/85Ucaejfj42M5ov.png https://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=PageLoadMetricsBrowserTestWithAnimatedLCPFlag.PageLCPNonAnimatedImage&testType=browser_tests%20on%20Mac-11 https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/1167/overview Original change's description: > Reland "[LCP] Add animated image support" > > This is a reland of b7d510c06e0436cfb4bd7260175cd460b949225c > > Original change's description: > > [LCP] Add animated image support > > > > This CL adds support for better handling of animated images in LCP: > > * A new attribute is exposing the first animated frame's paint time > > (behind a flag). > > * `startTime` is not changed. > > * The PageLoadMetrics reported for LCP are set to that first frame paint > > time for animated images (behind another flag). > > * Entries are not emitted until the image is loaded. > > > > Relevant spec issue: > > https://github.com/WICG/largest-contentful-paint/issues/83 > > > > Change-Id: I6bb01eacb4f200f9c032ffcfcd9a1a41126a7773 > > Bug: 1260953 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3226157 > > Commit-Queue: Yoav Weiss > > Reviewed-by: Nicolás Peña Moreno > > Cr-Commit-Position: refs/heads/main@{#935133} > > Bug: 1260953 > Change-Id: I5eaaf0cfd1daa7fb905e68aed4994cb931dc7750 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3247449 > Commit-Queue: Yoav Weiss > Reviewed-by: Nicolás Peña Moreno > Cr-Commit-Position: refs/heads/main@{#935635} Bug: 1260953 Change-Id: I07f60d8c423a3458cf7230843a8258682be134ad No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3249376 Commit-Queue: Glen Robertson Auto-Submit: Glen Robertson Owners-Override: Glen Robertson Reviewed-by: Alan Cutter Cr-Commit-Position: refs/heads/main@{#935767} -- wpt-commits: 6f1e59b3d9649ea984b0e8ae6e27426d2811ae96 wpt-pr: 31412 --- .../web-platform/tests/images/anim-tao.png | Bin 460 -> 0 bytes .../tests/images/anim-tao.png.headers | 2 -- .../tests/images/webp-animated.webp | Bin 340 -> 0 bytes .../observe-animated-image-gif.tentative.html | 27 --------------- ...observe-animated-image-webp.tentative.html | 27 --------------- .../observe-animated-image.tentative.html | 29 ---------------- ...cross-origin-animated-image.tentative.html | 30 ---------------- ...s-origin-tao-animated-image.tentative.html | 30 ---------------- .../observe-non-animated-image.tentative.html | 27 --------------- .../largest-contentful-paint-helpers.js | 32 ------------------ 10 files changed, 204 deletions(-) delete mode 100644 testing/web-platform/tests/images/anim-tao.png delete mode 100644 testing/web-platform/tests/images/anim-tao.png.headers delete mode 100644 testing/web-platform/tests/images/webp-animated.webp delete mode 100644 testing/web-platform/tests/largest-contentful-paint/animated/observe-animated-image-gif.tentative.html delete mode 100644 testing/web-platform/tests/largest-contentful-paint/animated/observe-animated-image-webp.tentative.html delete mode 100644 testing/web-platform/tests/largest-contentful-paint/animated/observe-animated-image.tentative.html delete mode 100644 testing/web-platform/tests/largest-contentful-paint/animated/observe-cross-origin-animated-image.tentative.html delete mode 100644 testing/web-platform/tests/largest-contentful-paint/animated/observe-cross-origin-tao-animated-image.tentative.html delete mode 100644 testing/web-platform/tests/largest-contentful-paint/animated/observe-non-animated-image.tentative.html diff --git a/testing/web-platform/tests/images/anim-tao.png b/testing/web-platform/tests/images/anim-tao.png deleted file mode 100644 index 925e2efc9a97ade490f04d57271adc10b2fe69b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 460 zcmeAS@N?(olHy`uVBq!ia0vp^DL`z*!3HE(nbz$CQXGlNAwEEw35Xd!_f9SVQc`IU zF^~{g1Bd|zjLa_>8Ci1NIDx$Bo-U3d6?5L6GvoytbHL!w?6zvIV;iqHq?@gO(Ktbl zoS|)rq)@U)kD_7Q5eZr|_$v>-*5=KZ^ai?#!PC{xWt~$( F698Hck68c! diff --git a/testing/web-platform/tests/images/anim-tao.png.headers b/testing/web-platform/tests/images/anim-tao.png.headers deleted file mode 100644 index 0230e176e4456..0000000000000 --- a/testing/web-platform/tests/images/anim-tao.png.headers +++ /dev/null @@ -1,2 +0,0 @@ -Timing-Allow-Origin: * - diff --git a/testing/web-platform/tests/images/webp-animated.webp b/testing/web-platform/tests/images/webp-animated.webp deleted file mode 100644 index 35a8dfcf34d58060ec70f0a2a04e0d58e357e084..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 340 zcmWIYbaV4zWMBw)bqWXzu!!JdU|B|P>F);l9590Z{MS*!B0;1vt zGXn!qpN|tzM4yX+ok3hd%;(wvmN~~P`X2vb?_+b_xHcr*I-p6!<-_fEjddq~hN*SD z*x#_=1f%tZIXZErQ(4dTt19a~HWL-+;f2`%bPy{81JGsx28J&{4%`Md1{Rq&&Br)8)v=KKh9&++1c^WpP^yW)$4OZRe!M0 zE0}Gar~tAd2Iy9xp+E$*fuDf^<_8y$AJ`5sgKbEX!)8O4^vRv~{y8UIh - - - - Largest Contentful Paint: observe image. - - - - - - - - diff --git a/testing/web-platform/tests/largest-contentful-paint/animated/observe-animated-image-webp.tentative.html b/testing/web-platform/tests/largest-contentful-paint/animated/observe-animated-image-webp.tentative.html deleted file mode 100644 index de59d5c5f78c6..0000000000000 --- a/testing/web-platform/tests/largest-contentful-paint/animated/observe-animated-image-webp.tentative.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - Largest Contentful Paint: observe image. - - - - - - - - diff --git a/testing/web-platform/tests/largest-contentful-paint/animated/observe-animated-image.tentative.html b/testing/web-platform/tests/largest-contentful-paint/animated/observe-animated-image.tentative.html deleted file mode 100644 index cf7d262b0f842..0000000000000 --- a/testing/web-platform/tests/largest-contentful-paint/animated/observe-animated-image.tentative.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Largest Contentful Paint: observe image. - - - - - - - - diff --git a/testing/web-platform/tests/largest-contentful-paint/animated/observe-cross-origin-animated-image.tentative.html b/testing/web-platform/tests/largest-contentful-paint/animated/observe-cross-origin-animated-image.tentative.html deleted file mode 100644 index 993883c607b8f..0000000000000 --- a/testing/web-platform/tests/largest-contentful-paint/animated/observe-cross-origin-animated-image.tentative.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Largest Contentful Paint: observe image. - - - - - - - - - diff --git a/testing/web-platform/tests/largest-contentful-paint/animated/observe-cross-origin-tao-animated-image.tentative.html b/testing/web-platform/tests/largest-contentful-paint/animated/observe-cross-origin-tao-animated-image.tentative.html deleted file mode 100644 index 137dde66383f7..0000000000000 --- a/testing/web-platform/tests/largest-contentful-paint/animated/observe-cross-origin-tao-animated-image.tentative.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Largest Contentful Paint: observe image. - - - - - - - - - diff --git a/testing/web-platform/tests/largest-contentful-paint/animated/observe-non-animated-image.tentative.html b/testing/web-platform/tests/largest-contentful-paint/animated/observe-non-animated-image.tentative.html deleted file mode 100644 index 6bbc0958b1deb..0000000000000 --- a/testing/web-platform/tests/largest-contentful-paint/animated/observe-non-animated-image.tentative.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - Largest Contentful Paint: observe image. - - - - - - - - diff --git a/testing/web-platform/tests/largest-contentful-paint/resources/largest-contentful-paint-helpers.js b/testing/web-platform/tests/largest-contentful-paint/resources/largest-contentful-paint-helpers.js index 5012faf3b1be3..e12ece0a7561c 100644 --- a/testing/web-platform/tests/largest-contentful-paint/resources/largest-contentful-paint-helpers.js +++ b/testing/web-platform/tests/largest-contentful-paint/resources/largest-contentful-paint-helpers.js @@ -1,6 +1,3 @@ -const image_delay = 1000; -const delay_pipe_value = image_delay / 1000; - // Receives an image LargestContentfulPaint |entry| and checks |entry|'s attribute values. // The |timeLowerBound| parameter is a lower bound on the loadTime value of the entry. // The |options| parameter may contain some string values specifying the following: @@ -36,33 +33,4 @@ function checkImage(entry, expectedUrl, expectedID, expectedSize, timeLowerBound } else { assert_equals(entry.size, expectedSize); } - if (options.includes('animated')) { - assert_greater_than(entry.loadTime, entry.firstAnimatedFrameTime, - 'firstAnimatedFrameTime should be smaller than loadTime'); - assert_greater_than(entry.renderTime, entry.firstAnimatedFrameTime, - 'firstAnimatedFrameTime should be smaller than renderTime'); - assert_less_than(entry.firstAnimatedFrameTime, image_delay, - 'firstAnimatedFrameTime should be smaller than the delay applied to the second frame'); - assert_greater_than(entry.firstAnimatedFrameTime, 0, - 'firstAnimatedFrameTime should be larger than 0'); - } - if (options.includes('animated-zero')) { - assert_equals(entry.firstAnimatedFrameTime, 0, 'firstAnimatedFrameTime should be 0'); - } } - -const load_and_observe = url => { - return new Promise(resolve => { - (new PerformanceObserver(entryList => { - for (let entry of entryList.getEntries()) { - if (entry.url == url) { - resolve(entryList.getEntries()[0]); - } - } - })).observe({type: 'largest-contentful-paint', buffered: true}); - const img = new Image(); - img.id = 'image_id'; - img.src = url; - document.body.appendChild(img); - }); -};