[chromium] Add a layout test for losing the compositor context with a video playing
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 21:47:51 +0000 (21:47 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 21:47:51 +0000 (21:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78060

Reviewed by Eric Carlson.

Adds a test to prevent regressions with video playback when we lose the compositor context. This test loads up a
video, forces a frame to be displayed, simulates a lost context, then finishes the test (which causes another
frame to be displayed).

Prior to r106610 this test times out in debug and crashes in ASAN.

* platform/chromium/compositing/lost-compositor-context-with-video-expected.png: Added.
* platform/chromium/compositing/lost-compositor-context-with-video-expected.txt: Added.
* platform/chromium/compositing/lost-compositor-context-with-video.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107132 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/chromium/compositing/lost-compositor-context-with-video-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium/compositing/lost-compositor-context-with-video-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/compositing/lost-compositor-context-with-video.html [new file with mode: 0644]

index 825c3eb..e6bc368 100644 (file)
@@ -1,3 +1,20 @@
+2012-02-08  James Robinson  <jamesr@chromium.org>
+
+        [chromium] Add a layout test for losing the compositor context with a video playing
+        https://bugs.webkit.org/show_bug.cgi?id=78060
+
+        Reviewed by Eric Carlson.
+
+        Adds a test to prevent regressions with video playback when we lose the compositor context. This test loads up a
+        video, forces a frame to be displayed, simulates a lost context, then finishes the test (which causes another
+        frame to be displayed).
+
+        Prior to r106610 this test times out in debug and crashes in ASAN.
+
+        * platform/chromium/compositing/lost-compositor-context-with-video-expected.png: Added.
+        * platform/chromium/compositing/lost-compositor-context-with-video-expected.txt: Added.
+        * platform/chromium/compositing/lost-compositor-context-with-video.html: Added.
+
 2012-02-08  Emil A Eklund  <eae@chromium.org>
 
         Update pixel table test expectations for mac to match new DRT scrollbars
diff --git a/LayoutTests/platform/chromium/compositing/lost-compositor-context-with-video-expected.png b/LayoutTests/platform/chromium/compositing/lost-compositor-context-with-video-expected.png
new file mode 100644 (file)
index 0000000..5e183a5
Binary files /dev/null and b/LayoutTests/platform/chromium/compositing/lost-compositor-context-with-video-expected.png differ
diff --git a/LayoutTests/platform/chromium/compositing/lost-compositor-context-with-video-expected.txt b/LayoutTests/platform/chromium/compositing/lost-compositor-context-with-video-expected.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/LayoutTests/platform/chromium/compositing/lost-compositor-context-with-video.html b/LayoutTests/platform/chromium/compositing/lost-compositor-context-with-video.html
new file mode 100644 (file)
index 0000000..20416f3
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- This test passes if it doesn't crash or timeout -->
+<html>
+<head>
+<script src="../../../media/media-file.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText(true);  // This is only useful as a pixel test.
+    layoutTestController.waitUntilDone();
+}
+
+function test() {
+    var v = document.querySelector('video');
+    v.addEventListener("seeked", function() {
+        if (window.layoutTestController) {
+            layoutTestController.display();
+            layoutTestController.loseCompositorContext(1);
+            layoutTestController.display();
+            layoutTestController.notifyDone();
+        }
+    }, false);
+    v.currentTime = 0;
+}
+</script>
+<body onload="setSrcByTagName('video', findMediaFile('video', '../../../media/content/test-25fps'));">
+<video oncanplaythrough="test();"></video>
+</body>
+</html>