Bug 1649619 [wpt PR 24402] - [PaintTiming] Let videos trigger FCP, a=testonly
[gecko.git] / testing / web-platform / tests / paint-timing / fcp-only / fcp-video-frame.html
blob9089883cdfbd0a836a3211e24a0208dd5edf0ee9
1 <!DOCTYPE html>
2 <head>
3 <title>Performance Paint Timing Test: FCP due to loaded video frame</title>
4 </head>
5 <body>
6 <script src="../resources/utils.js"></script>
7 <script src="/resources/testharness.js"></script>
8 <script src="/resources/testharnessreport.js"></script>
9 <script src="/common/media.js"></script>
10 <video id="video" autoplay></video>
11 <script>
12 promise_test(async t => {
13 assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
14 await new Promise(r => window.addEventListener('load', r));
15 await assertNoFirstContentfulPaint(t);
16 // Set actual video content to trigger FCP.
17 const video = document.getElementById('video');
18 video.src = getVideoURI('/media/test');
19 await new Promise(resolve => {
20 video.oncanplay = resolve;
21 });
22 await assertFirstContentfulPaint(t);
23 }, 'Video should become contentful when first frame is loaded');
24 </script>
25 </body>
26 </html>