From 7a648dc65a20d644a1a024063a85c7a7e9bd402c Mon Sep 17 00:00:00 2001 From: Dominic Farolino Date: Tue, 28 Apr 2020 11:28:28 +0000 Subject: [PATCH] Bug 1631110 [wpt PR 23076] - Clean up lazy load tests, a=testonly Automatic update from web-platform-tests Clean up lazy load tests This CL cleans up the image lazy loading cross-origin iframe tests. The tests assert that lazy loading works even for images in cross-origin iframes. Before this CL, the main test files didn't make use of promise_test correctly, so the tests would just timeout for implementations that didn't support lazy load. This happened because none of the promises the test awaits actually perform assertions, so in the error case, they never resolve or reject. This CL fixes that by refactoring the tests to use a chain of promises that correctly employ assertions, and return a final fulfilled promise. R=sclittle@chromium.org Bug: N/A Change-Id: I4462cf7fd3d2a67fc1ccfb18ec8196bfdb50891f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2154820 Reviewed-by: Scott Little Commit-Queue: Dominic Farolino Cr-Commit-Position: refs/heads/master@{#760205} -- wpt-commits: 248e44b485b2a69c1c25f7c6f64b681b3aca4424 wpt-pr: 23076 --- ...g-lazy-in-cross-origin-iframe-001.sub.html | 59 +++++++++---------- ...g-lazy-in-cross-origin-iframe-002.sub.html | 55 ++++++++--------- ...oading-lazy-in-script-disabled-iframe.html | 2 +- ...lazy-move-into-script-disabled-iframe.html | 2 +- ...=> image-loading-lazy-below-viewport.html} | 4 ++ ...ml => image-loading-lazy-in-viewport.html} | 6 ++ 6 files changed, 69 insertions(+), 59 deletions(-) rename testing/web-platform/tests/html/semantics/embedded-content/the-img-element/resources/{image-loading-lazy-below-viewport-iframe.html => image-loading-lazy-below-viewport.html} (89%) rename testing/web-platform/tests/html/semantics/embedded-content/the-img-element/resources/{image-loading-lazy-in-viewport-iframe.html => image-loading-lazy-in-viewport.html} (66%) diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-001.sub.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-001.sub.html index a4627cb8c25d..eed364465060 100644 --- a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-001.sub.html +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-001.sub.html @@ -1,45 +1,44 @@ -An image with loading='lazy' in cross origin iframe loads when it gets - visible by scrolling the iframe's scroll port - +A below-viewport loading=lazy image in a cross origin iframe loads only + when scrolled into viewport + + + + diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-002.sub.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-002.sub.html index 1d3d3bc46a6d..85060d2193d0 100644 --- a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-002.sub.html +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-002.sub.html @@ -1,8 +1,10 @@ -An image with loading='lazy' in cross origin iframe loads when it gets - visible by scrolling the parent scroll container of the iframe - +A loading=lazy image in a below-viewport cross-origin iframe loads only + when the cross-origin iframe is scrolled into view + + + @@ -10,36 +12,35 @@
+ diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-script-disabled-iframe.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-script-disabled-iframe.html index 05b51705e722..fbcadd86c99c 100644 --- a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-script-disabled-iframe.html +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-script-disabled-iframe.html @@ -9,7 +9,7 @@