Reduce the number of compositing test failures
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jan 2012 01:18:20 +0000 (01:18 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jan 2012 01:18:20 +0000 (01:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=76495

Reviewed by James Robinson.

General cleanup of compositing tests:
    * video tests now do a seek to guarantee that the pixel result will show a frame
    * video tests use a shared JS file (can't use media/video-test.js because it always
    calls dumpAsText(), which is not reversible).
    * ideo-with-invalid-source.html fixed to use a file extension so that the
    error event fires (bug 76494).
    * pixel results rebaselined.

* compositing/geometry/clipped-video-controller.html:
* compositing/geometry/video-fixed-scrolling.html:
* compositing/geometry/video-opacity-overlay.html:
* compositing/layers-inside-overflow-scroll.html:
* compositing/overflow/scroll-ancestor-update.html:
* compositing/reflections/load-video-in-reflection.html:
* compositing/resources/media-testing.js: Added.
(ensureFrameVisible):
* compositing/self-painting-layers.html:
* compositing/video/video-with-invalid-source.html:
* compositing/visibility/visibility-simple-video-layer.html:
* platform/mac/compositing/color-matching/image-color-matching-expected.png:
* platform/mac/compositing/geometry/video-fixed-scrolling-expected.png:
* platform/mac/compositing/geometry/video-opacity-overlay-expected.png:
* platform/mac/compositing/layers-inside-overflow-scroll-expected.png:
* platform/mac/compositing/overflow/scroll-ancestor-update-expected.png:
* platform/mac/compositing/overflow/scroll-ancestor-update-expected.txt:
* platform/mac/compositing/plugins/composited-plugin-expected.png:
* platform/mac/compositing/reflections/load-video-in-reflection-expected.png:
* platform/mac/compositing/reflections/simple-composited-reflections-expected.png:
* platform/mac/compositing/self-painting-layers-expected.png:
* platform/mac/compositing/video/video-background-color-expected.png:
* platform/mac/test_expectations.txt:

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

23 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/geometry/clipped-video-controller.html
LayoutTests/compositing/geometry/video-fixed-scrolling.html
LayoutTests/compositing/geometry/video-opacity-overlay.html
LayoutTests/compositing/layers-inside-overflow-scroll.html
LayoutTests/compositing/overflow/scroll-ancestor-update.html
LayoutTests/compositing/reflections/load-video-in-reflection.html
LayoutTests/compositing/resources/media-testing.js [new file with mode: 0644]
LayoutTests/compositing/self-painting-layers.html
LayoutTests/compositing/video/video-with-invalid-source.html
LayoutTests/compositing/visibility/visibility-simple-video-layer.html
LayoutTests/platform/mac/compositing/color-matching/image-color-matching-expected.png
LayoutTests/platform/mac/compositing/geometry/video-fixed-scrolling-expected.png
LayoutTests/platform/mac/compositing/geometry/video-opacity-overlay-expected.png
LayoutTests/platform/mac/compositing/layers-inside-overflow-scroll-expected.png
LayoutTests/platform/mac/compositing/overflow/scroll-ancestor-update-expected.png
LayoutTests/platform/mac/compositing/overflow/scroll-ancestor-update-expected.txt
LayoutTests/platform/mac/compositing/plugins/composited-plugin-expected.png
LayoutTests/platform/mac/compositing/reflections/load-video-in-reflection-expected.png
LayoutTests/platform/mac/compositing/reflections/simple-composited-reflections-expected.png
LayoutTests/platform/mac/compositing/self-painting-layers-expected.png
LayoutTests/platform/mac/compositing/video/video-background-color-expected.png
LayoutTests/platform/mac/test_expectations.txt

index 60e0e16..2977c8d 100644 (file)
@@ -1,3 +1,42 @@
+2012-01-17  Simon Fraser  <simon.fraser@apple.com>
+
+        Reduce the number of compositing test failures
+        https://bugs.webkit.org/show_bug.cgi?id=76495
+
+        Reviewed by James Robinson.
+
+        General cleanup of compositing tests:
+            * video tests now do a seek to guarantee that the pixel result will show a frame
+            * video tests use a shared JS file (can't use media/video-test.js because it always
+            calls dumpAsText(), which is not reversible).
+            * ideo-with-invalid-source.html fixed to use a file extension so that the
+            error event fires (bug 76494).
+            * pixel results rebaselined.
+
+        * compositing/geometry/clipped-video-controller.html:
+        * compositing/geometry/video-fixed-scrolling.html:
+        * compositing/geometry/video-opacity-overlay.html:
+        * compositing/layers-inside-overflow-scroll.html:
+        * compositing/overflow/scroll-ancestor-update.html:
+        * compositing/reflections/load-video-in-reflection.html:
+        * compositing/resources/media-testing.js: Added.
+        (ensureFrameVisible):
+        * compositing/self-painting-layers.html:
+        * compositing/video/video-with-invalid-source.html:
+        * compositing/visibility/visibility-simple-video-layer.html:
+        * platform/mac/compositing/color-matching/image-color-matching-expected.png:
+        * platform/mac/compositing/geometry/video-fixed-scrolling-expected.png:
+        * platform/mac/compositing/geometry/video-opacity-overlay-expected.png:
+        * platform/mac/compositing/layers-inside-overflow-scroll-expected.png:
+        * platform/mac/compositing/overflow/scroll-ancestor-update-expected.png:
+        * platform/mac/compositing/overflow/scroll-ancestor-update-expected.txt:
+        * platform/mac/compositing/plugins/composited-plugin-expected.png:
+        * platform/mac/compositing/reflections/load-video-in-reflection-expected.png:
+        * platform/mac/compositing/reflections/simple-composited-reflections-expected.png:
+        * platform/mac/compositing/self-painting-layers-expected.png:
+        * platform/mac/compositing/video/video-background-color-expected.png:
+        * platform/mac/test_expectations.txt:
+
 2012-01-17  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
 
         Uint8ClampedArray support
index 706722c..36aeef8 100644 (file)
@@ -1,10 +1,7 @@
 <!DOCTYPE html>
 
-<html lang="en">
+<html>
 <head>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-  <title>Clipped Video</title>
-</head>
   <style>
     
       #box {
       }
     
   </style>
+  <script src="../resources/media-testing.js"></script>
+  <script src="../../media/media-file.js"></script>
+
   <script type="text/javascript" charset="utf-8">
-    if (window.layoutTestController) {
-      layoutTestController.dumpAsText(true);
-      layoutTestController.waitUntilDone();
+    if (window.layoutTestController)
+      layoutTestController.dumpAsText();
+  
+    function testDone()
+    {
+      if (window.layoutTestController)
+        layoutTestController.notifyDone();
     }
-  </script>
 
-<body>
+    function doTest()
+    {
+      var video = document.getElementsByTagName('video')[0];
+      setupVideo(video, '../resources/video', null, testDone);
+    }
+  </script>
+</head>
+<body onload="doTest()">
     <p>The video controller should not be visible below</p>
     <div id="box">
       <video controls></video>
     </div>
-    <script type="text/javascript" charset="utf-8">
-      var video = document.getElementsByTagName('video')[0];
-      video.src = '../resources/video.' + (video.canPlayType('video/ogg') ? 'ogv' : 'mp4');
-      video.addEventListener('canplaythrough', function() {
-        if (window.layoutTestController)
-          layoutTestController.notifyDone();
-      }, false);
-    </script>
 </body>
 </html>
index 9905d9a..3ce3968 100644 (file)
       background-color: rgba(0, 0, 255, 0.8);
     }
   </style>
+  <script src="../resources/media-testing.js"></script>
+  <script src="../../media/media-file.js"></script>
   <script type="text/javascript" charset="utf-8">
-    if (window.layoutTestController)
-      layoutTestController.waitUntilDone();
+    function testDone()
+    {
+      if (window.layoutTestController)
+        layoutTestController.notifyDone();
+    }
+
+    function modifyDocument()
+    {
+      window.scrollBy(50, 50);
+    }
+
+    function doTest()
+    {
+      var video = document.getElementsByTagName('video')[0];
+      setupVideo(video, '../resources/video', modifyDocument, testDone);
+    }
   </script>
 </head>
-<body>
+<body onload="doTest()">
     <video></video>
 
     <p>The blue bar should be in front of the video, and at the top of the page.</p>
     <div id="fixed-bar"></div>
-
-  <script type="text/javascript" charset="utf-8">
-    var video = document.getElementsByTagName('video')[0];
-    video.src = '../resources/video.' + (video.canPlayType('video/ogg') ? 'ogv' : 'mp4');
-    video.addEventListener('canplaythrough', function() {
-      window.scrollBy(50, 50);
-      if (window.layoutTestController)
-        layoutTestController.notifyDone();
-    }, false);
-  </script>
 </body>
 </html>
index 6f574c4..0063977 100644 (file)
@@ -1,10 +1,7 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
-  "http://www.w3.org/TR/html4/strict.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-  <title>Video overlay</title>
-  <style type="text/css" media="screen">
+  <style>
     video {
       width: 100%;
       height: 100%;
       background-color: orange;
     }
   </style>
+  <script src="../resources/media-testing.js"></script>
+  <script src="../../media/media-file.js"></script>
   <script type="text/javascript" charset="utf-8">
-    if (window.layoutTestController)
-      layoutTestController.waitUntilDone();
+    function testDone()
+    {
+      if (window.layoutTestController)
+        layoutTestController.notifyDone();
+    }
+
+    function doTest()
+    {
+      var video = document.getElementsByTagName('video')[0];
+      setupVideo(video, '../resources/video', null, testDone);
+    }
   </script>
 </head>
-<body>
+<body onload="doTest()">
   <p>The orange bar should be in front of the video.</p>
   <div class="container">
     <video></video>
       <div id="control-bar"></div>
     </div>
   </div>
-  <script type="text/javascript" charset="utf-8">
-    var video = document.getElementsByTagName('video')[0];
-    video.src = '../resources/video.' + (video.canPlayType('video/ogg') ? 'ogv' : 'mp4');
-    video.addEventListener('canplaythrough', function() {
-      if (window.layoutTestController)
-        layoutTestController.notifyDone();
-    }, false);
-  </script>
+
 </body>
 </html>
index b001abd..e78008a 100644 (file)
       -webkit-transform: translateZ(0);
     }
     </style>
-    <script type="text/javascript" charset="utf-8">
-      if (window.layoutTestController)
-        layoutTestController.waitUntilDone();
+    <script src="resources/media-testing.js"></script>
+    <script src="../media/media-file.js"></script>
 
-      function testOnLoad()
+    <script type="text/javascript" charset="utf-8">
+      function testDone()
+      {
+        if (window.layoutTestController)
+          layoutTestController.notifyDone();
+      }
+      
+      function modifyDocument()
       {
-        window.setTimeout(function() {
           document.getElementById('details').scrollTop = 100;
-          if (window.layoutTestController)
-            layoutTestController.notifyDone();
-        }, 0);
       }
       
-      window.addEventListener('load', function() {
-        var video = document.getElementById('video');
-        video.addEventListener('loadeddata', testOnLoad, false);
-        video.src = 'resources/video.' + (video.canPlayType('video/ogg') ? 'ogv' : 'mp4');
-      }, false);
+      function doTest()
+      {
+          var video = document.getElementsByTagName('video')[0];
+          setupVideo(video, 'resources/video', modifyDocument, testDone);
+      }
     </script>
   </head>
-  <body>
+  <body onload="doTest()">
       <p>The red box in the overflow:scroll div should be scrolled out of view.</p>
         <div id="container">
-          <video id="video" width="300" height="200"></video>
+          <video width="300" height="200"></video>
         </div>
 
         <div id="details">
index cb631c3..a99eda4 100644 (file)
             background-color: red;
         }
     </style>
+
+    <script src="../resources/media-testing.js"></script>
+    <script src="../../media/media-file.js"></script>
     <script type="text/javascript" charset="utf-8">
+      function testDone()
+      {
         if (window.layoutTestController)
-          layoutTestController.waitUntilDone();
-        
-        function scrollTestDiv()
-        {
-            var scroller = document.getElementById('scroller');
-            scroller.scrollTop = 50;
-        }
+          layoutTestController.notifyDone();
+      }
+
+      function modifyDocument()
+      {
+        document.getElementById('scroller').scrollTop = 50;
+      }
+
+      function doTest()
+      {
+        var video = document.getElementsByTagName('video')[0];
+        setupVideo(video, '../resources/video', modifyDocument, testDone);
+      }
     </script>
 </head>
-<body>
+<body onload="doTest()">
   
   <div class="indicator box"></div>
 
   
   <video></video>
 
-  <script type="text/javascript" charset="utf-8">
-    var video = document.getElementsByTagName('video')[0];
-    video.src = '../resources/video.' + (video.canPlayType('video/ogg') ? 'ogv' : 'mp4');
-    video.addEventListener('canplaythrough', function() {
-      scrollTestDiv();
-      if (window.layoutTestController)
-        layoutTestController.notifyDone();
-    }, false);
-  </script>
 </body>
 </html>
index d277294..4476b01 100644 (file)
     }
 
   </style>
+  <script src="../resources/media-testing.js"></script>
+  <script src="../../media/media-file.js"></script>
   <script type="text/javascript" charset="utf-8">
-    
-    if (window.layoutTestController)
-      layoutTestController.waitUntilDone();
-
-    function videoLoaded()
+    function testDone()
     {
       if (window.layoutTestController)
         layoutTestController.notifyDone();
     }
 
-    function runTest()
+    function doTest()
     {
       var video = document.getElementsByTagName('video')[0];
-      video.addEventListener('canplaythrough', videoLoaded, false);
-      
-      window.setTimeout(function() {
-        video.src = '../resources/video.' + (video.canPlayType('video/ogg') ? 'ogv' : 'mp4');
-      }, 100);
+      setupVideo(video, '../resources/video', null, testDone);
     }
-    
-    window.addEventListener('load', runTest, false)
   </script>
 </head>
-<body>
+<body onload="doTest()">
   <p>You should see a reflected video below, rather than the red video background.</p>
   <div class="container">
     <video></video>
diff --git a/LayoutTests/compositing/resources/media-testing.js b/LayoutTests/compositing/resources/media-testing.js
new file mode 100644 (file)
index 0000000..b75a557
--- /dev/null
@@ -0,0 +1,20 @@
+
+if (window.layoutTestController)
+    layoutTestController.waitUntilDone();
+
+function ensureFrameVisible(video, videoRenderedCallbac)
+{
+    video.addEventListener('seeked', videoRenderedCallbac, false);
+    video.currentTime = 0.5;
+}
+
+function setupVideo(videoElement, videoPath, canPlayThroughCallback, videoRenderedCallbac)
+{
+    var mediaFile = findMediaFile("video", videoPath);
+    videoElement.addEventListener("canplaythrough", function () {
+        if (canPlayThroughCallback)
+            canPlayThroughCallback();
+        ensureFrameVisible(this, videoRenderedCallbac);
+    }, false);
+    videoElement.src = mediaFile;
+}
index ff1f164..74eba1a 100644 (file)
       font-size: 24pt;
       line-height: 150%;
     }
-    
     </style>
+
+    <script src="resources/media-testing.js"></script>
+    <script src="../media/media-file.js"></script>
+
     <script type="text/javascript" charset="utf-8">
-      if (window.layoutTestController)
-        layoutTestController.waitUntilDone();
+      function testDone()
+      {
+        if (window.layoutTestController)
+          layoutTestController.notifyDone();
+      }
+
+      function modifyDocument()
+      {
+        document.getElementById('details').scrollTop = 24;
+      }
 
-      function testOnLoad()
+      function doTest()
       {
-        window.setTimeout(function() {
-          document.getElementById('details').scrollTop = 24;
-          if (window.layoutTestController)
-            layoutTestController.notifyDone();
-        }, 0);
+        var video = document.getElementsByTagName('video')[0];
+        setupVideo(video, 'resources/video', modifyDocument, testDone);
       }
-      
-      window.addEventListener('load', function() {
-        var video = document.getElementById('video');
-        video.addEventListener('loadeddata', testOnLoad, false);
-        video.src = 'resources/video.' + (video.canPlayType('video/ogg') ? 'ogv' : 'mp4');
-      }, false);
     </script>
   </head>
-  <body>
+  <body onload="doTest()">
       <p>You should not see double text when the div scrolls</p>
         <div id="container">
           <video id="video" width="300" height="200"></video>
index 06278b1..a6c4acc 100644 (file)
@@ -9,7 +9,7 @@ function test() {
     var v = document.createElement("video");\r
     document.body.appendChild(v);\r
     var src = document.createElement("source");\r
-    src.src = "notarealsource";\r
+    src.src = "notarealsource.txt";\r
     v.appendChild(src);\r
     src.addEventListener("error", function() {\r
        if (window.layoutTestController) {\r
index d5bd6e7..4c63bb1 100644 (file)
       }
     </style>
 
-    <script>
-      if (window.layoutTestController) {
+    <script src="../resources/media-testing.js"></script>
+    <script src="../../media/media-file.js"></script>
+    <script type="text/javascript" charset="utf-8">
+      if (window.layoutTestController)
           layoutTestController.dumpAsText(true);
-          layoutTestController.waitUntilDone();
-      }
 
       var counter = 0;
       function notifyVideoDone() {
               layoutTestController.notifyDone();
       }
 
-      function playVideoOnElement(video) {
-          video.src = '../resources/video.' + (video.canPlayType('video/ogg') ? 'ogv' : 'mov');
-          video.addEventListener('ended', function(event) {
-              notifyVideoDone();
-          }, false);
-      }
-
-      function init() {
-          playVideoOnElement(document.getElementsByTagName('video')[0]);
-          playVideoOnElement(document.getElementsByTagName('video')[1]);
-          playVideoOnElement(document.getElementsByTagName('video')[2]);
+      function doTest()
+      {
+          setupVideo(document.getElementsByTagName('video')[0], '../resources/video', null, notifyVideoDone);
+          setupVideo(document.getElementsByTagName('video')[1], '../resources/video', null, notifyVideoDone);
+          setupVideo(document.getElementsByTagName('video')[2], '../resources/video', null, notifyVideoDone);
       }
     </script>
   </head>
 
-  <body onload="init()">
+  <body onload="doTest()">
     <!-- Tests CSS visibility flag for composited video layers. -->
     <!-- Pixel test only. Only the top video should be visible, the other two should be hidden (borders should remain visible) -->
-    <div><video class="visible composited box" autoplay></video></div>
-    <div><video class="hidden box" autoplay></video></div>
-    <div><video class="hidden composited box" autoplay></video></div>
+    <div><video class="visible composited box"></video></div>
+    <div><video class="hidden box"></video></div>
+    <div><video class="hidden composited box"></video></div>
   </body>
 </html>
index 00a988e..1d72890 100644 (file)
Binary files a/LayoutTests/platform/mac/compositing/color-matching/image-color-matching-expected.png and b/LayoutTests/platform/mac/compositing/color-matching/image-color-matching-expected.png differ
index 258714c..feee924 100644 (file)
Binary files a/LayoutTests/platform/mac/compositing/geometry/video-fixed-scrolling-expected.png and b/LayoutTests/platform/mac/compositing/geometry/video-fixed-scrolling-expected.png differ
index 7301b14..33904d4 100644 (file)
Binary files a/LayoutTests/platform/mac/compositing/geometry/video-opacity-overlay-expected.png and b/LayoutTests/platform/mac/compositing/geometry/video-opacity-overlay-expected.png differ
index ff7cb0d..68bd3c0 100644 (file)
Binary files a/LayoutTests/platform/mac/compositing/layers-inside-overflow-scroll-expected.png and b/LayoutTests/platform/mac/compositing/layers-inside-overflow-scroll-expected.png differ
index f03fe0b..327553f 100644 (file)
Binary files a/LayoutTests/platform/mac/compositing/overflow/scroll-ancestor-update-expected.png and b/LayoutTests/platform/mac/compositing/overflow/scroll-ancestor-update-expected.png differ
index ee973e2..a2fae2e 100644 (file)
@@ -4,7 +4,6 @@ layer at (0,0) size 800x104
   RenderBlock {HTML} at (0,0) size 800x104
     RenderBody {BODY} at (0,0) size 800x104
       RenderText {#text} at (0,0) size 0x0
-      RenderText {#text} at (0,0) size 0x0
 layer at (0,0) size 100x100
   RenderVideo {VIDEO} at (0,0) size 100x100
 layer at (50,50) size 100x100
index c23e71a..cc2cdc0 100644 (file)
Binary files a/LayoutTests/platform/mac/compositing/plugins/composited-plugin-expected.png and b/LayoutTests/platform/mac/compositing/plugins/composited-plugin-expected.png differ
index b06afe5..b1ac701 100644 (file)
Binary files a/LayoutTests/platform/mac/compositing/reflections/load-video-in-reflection-expected.png and b/LayoutTests/platform/mac/compositing/reflections/load-video-in-reflection-expected.png differ
index f8bb677..e41ac37 100644 (file)
Binary files a/LayoutTests/platform/mac/compositing/reflections/simple-composited-reflections-expected.png and b/LayoutTests/platform/mac/compositing/reflections/simple-composited-reflections-expected.png differ
index 950c71a..cf59683 100644 (file)
Binary files a/LayoutTests/platform/mac/compositing/self-painting-layers-expected.png and b/LayoutTests/platform/mac/compositing/self-painting-layers-expected.png differ
index abd8bde..5cdeadb 100644 (file)
Binary files a/LayoutTests/platform/mac/compositing/video/video-background-color-expected.png and b/LayoutTests/platform/mac/compositing/video/video-background-color-expected.png differ
index c90f3f9..fb082dc 100644 (file)
@@ -2,6 +2,9 @@
 //
 // See http://trac.webkit.org/wiki/TestExpectations for more information on this file.
 
+BUGWK76478 : compositing/iframes/repaint-after-losing-scrollbars.html = IMAGE
+BUGWK76489 : compositing/webgl/webgl-reflection.html = IMAGE
+
 // Our slow tests, in alphabetical order.
 BUGWK57672 : http/tests/local/fileapi/send-sliced-dragged-file.html = TEXT PASS