[chromium] Add a layout test for losing the compositor context with a video playing
[WebKit-https.git] / LayoutTests / platform / chromium / compositing / lost-compositor-context-with-video.html
1 <!DOCTYPE html>
2 <!-- This test passes if it doesn't crash or timeout -->
3 <html>
4 <head>
5 <script src="../../../media/media-file.js"></script>
6 <script>
7 if (window.layoutTestController) {
8     layoutTestController.dumpAsText(true);  // This is only useful as a pixel test.
9     layoutTestController.waitUntilDone();
10 }
11
12 function test() {
13     var v = document.querySelector('video');
14     v.addEventListener("seeked", function() {
15         if (window.layoutTestController) {
16             layoutTestController.display();
17             layoutTestController.loseCompositorContext(1);
18             layoutTestController.display();
19             layoutTestController.notifyDone();
20         }
21     }, false);
22     v.currentTime = 0;
23 }
24 </script>
25 <body onload="setSrcByTagName('video', findMediaFile('video', '../../../media/content/test-25fps'));">
26 <video oncanplaythrough="test();"></video>
27 </body>
28 </html>