Update web-platform-tests to revision 687b6cba3385c4c2ca85f44fe072961e651621b5

This commit is contained in:
WPT Sync Bot 2019-04-08 21:47:49 -04:00
parent cd579f6746
commit 1a4444a557
45 changed files with 594 additions and 259 deletions

View file

@ -26,7 +26,7 @@ img {
<body>
<p>Image inserted further below.</p>
<div id="image-container">
<img id="off" load="eager" src="http://{{hosts[alt][www1]}}:{{ports[http][0]}}/feature-policy/experimental-features/resources/lazyload.png"></img>
<img id="off" loading="eager" src="http://{{hosts[alt][www1]}}:{{ports[http][0]}}/feature-policy/experimental-features/resources/lazyload.png"></img>
</div>
<script>
var img = document.querySelector("img");
@ -35,11 +35,11 @@ img {
target.load_complete = wait_for_load(target).then(() => target.did_load = true );
});
// Sanity-check: Verify that when feature-policy 'lazyload' is enabled, the lazyload attribute
// value 'OFF' works as expected (images load immediately).
// Sanity-check: Verify that when feature-policy 'lazyload' is enabled, the attribute
// loading='eager' works as expected (images load immediately).
promise_test( async(t) => {
await window.load_complete;
assert_true(img.did_load, "Image should have loaded.");
}, "When feature is enabled, load=eager works as expected.");
}, "When feature is enabled, loading=eager works as expected.");
</script>
</body>

View file

@ -31,12 +31,12 @@ iframe {
window.scrollTo(0, 0);
// Sanity-check: Make sure load='lazy' works as intended.
// Sanity-check: Make sure loading='lazy' works as intended.
promise_test(async(t) => {
// Add a frame with load="lazy".
// Add a frame with loading="lazy".
let frame_on = createIframe(document.body, {
id: "ON",
load: "lazy",
loading: "lazy",
src: `${cross_origin_url}?id=ON`
});
// Sanity-check: The frame is not visible.
@ -48,17 +48,17 @@ iframe {
await waitForMessageOrTimeout(t, "ON", load_timeout);
assert_equals(msg_or_timeout_attr_on,
expected_timeout_msg,
"With load='lazy', the frame should not load.");
"With loading='lazy', the frame should not load.");
}, "Sanity-check: Contents do not load immediately (no eager-loading) " +
"when the load attribute is 'lazy' and frame is in viewport.");
"when the loading attribute is 'lazy' and frame is in viewport.");
// When feature is enabled, a frame can turn off lazy loading by setting the
// attribute to 'off'.
promise_test(async(t) => {
// Add a frame with load="eager".
// Add a frame with loading="eager".
let frame_off = createIframe(document.body, {
id: "OFF",
load: "eager",
loading: "eager",
src: `${cross_origin_url}?id=OFF`
});
// Sanity-check: The frame is not visible.
@ -71,7 +71,7 @@ iframe {
assert_equals(msg_or_timeout_attr_off,
expected_load_msg,
"With load='eager', the frame should load.");
"With loading='eager', the frame should load.");
}, "When 'lazyload' feature is enabled, a frame can avoid lazyloading by " +
"setting 'load' attribute to 'eager'");
"setting 'loading' attribute to 'eager'");
</script>