3 <title>Element Timing: observe video poster image
</title>
4 <script src=
"/resources/testharness.js"></script>
5 <script src=
"/resources/testharnessreport.js"></script>
6 <script src=
"resources/element-timing-helpers.js"></script>
9 async_test(function (t
) {
10 assert_precondition(window
.PerformanceElementTiming
, "PerformanceElementTiming is not implemented");
11 const observer
= new PerformanceObserver(
12 t
.step_func_done(function(entryList
) {
13 assert_equals(entryList
.getEntries().length
, 1);
14 const entry
= entryList
.getEntries()[0];
15 const pathname
= window
.location
.origin
+ '/element-timing/resources/circle.svg';
16 checkElement(entry
, pathname
, 'my_poster', 'the_poster', beforeRender
,
17 document
.getElementById('the_poster'));
18 // Assume viewport has size at least 200, so the element is fully visible.
19 checkRect(entry
, [0, 200, 0, 200]);
20 checkNaturalSize(entry
, 200, 200);
23 observer
.observe({entryTypes
: ['element']});
24 beforeRender
= performance
.now();
25 }, "Able to observe a video's poster image.");
32 <video elementtiming='my_poster' id='the_poster' src='/media/test.mp4' poster='resources/circle.svg'
/>