3 <title>Largest Contentful Paint: contracted image bounded by display size.
</title>
4 <style type=
"text/css">
11 <script src=
"/resources/testharness.js"></script>
12 <script src=
"/resources/testharnessreport.js"></script>
13 <script src=
"resources/largest-contentful-paint-helpers.js"></script>
15 async_test(function (t
) {
16 assert_precondition(window
.LargestContentfulPaint
, "LargestContentfulPaint is not implemented");
17 const beforeLoad
= performance
.now();
18 const observer
= new PerformanceObserver(
19 t
.step_func_done(function(entryList
) {
20 assert_equals(entryList
.getEntries().length
, 1);
21 const entry
= entryList
.getEntries()[0];
22 const url
= window
.location
.origin
+ '/images/black-rectangle.png';
23 // black-rectangle.png is 100 x 50. It occupies 50 x 50 so size will be bounded by the displayed size.
25 checkImage(entry
, url
, 'image_id', size
, beforeLoad
);
28 observer
.observe({type
: 'largest-contentful-paint', buffered
: true});
29 }, 'Largest Contentful Paint: |size| attribute is bounded by display size.');
31 <img src='/images/black-rectangle.png' id='image_id'
/>