Trigger a compositing update when video element is changing
[WebKit-https.git] / LayoutTests / compositing / video / video-update-rendering.html
1 <!doctype html>
2 <html>
3     <head>
4         <meta charset="utf-8">
5         <title>Video update rendering</title>
6         <script src="../../resources/testharness.js"></script>
7         <script src="../../resources/testharnessreport.js"></script>
8     </head>
9     <body>
10         <video id="video" muted playsinline preload="none"></video>
11         <script>
12 video.src = "../resources/video." + (video.canPlayType("video/ogg") ? "ogv" : "mp4");
13
14 promise_test(async () => {
15     assert_true(!!window.internals, "test requires internals");
16
17     await new Promise(resolve => window.onload = resolve);
18
19     internals.startTrackingCompositingUpdates();
20     await video.play();
21     assert_true(internals.compositingUpdateCount() > 1, "refreshing video rendering: " + internals.compositingUpdateCount());
22 }, 'Refresh rendering when starting to play a video');
23         </script>
24     </body>
25 </html>