Title: [113536] trunk/LayoutTests
Revision
113536
Author
[email protected]
Date
2012-04-06 19:04:32 -0700 (Fri, 06 Apr 2012)

Log Message

2012-04-06  Andrew Scherkus  <[email protected]>

        [chromium] Add layout tests that exercise rendering path for videos that have changing resolutions.
        https://bugs.webkit.org/show_bug.cgi?id=83383

        Reviewed by James Robinson.

        * platform/chromium/compositing/video-frame-size-change.html: Added.
        * platform/chromium/media/video-frame-size-change.html: Changed from dumpAsText() to pixel test

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (113535 => 113536)


--- trunk/LayoutTests/ChangeLog	2012-04-07 02:02:48 UTC (rev 113535)
+++ trunk/LayoutTests/ChangeLog	2012-04-07 02:04:32 UTC (rev 113536)
@@ -1,3 +1,13 @@
+2012-04-06  Andrew Scherkus  <[email protected]>
+
+        [chromium] Add layout tests that exercise rendering path for videos that have changing resolutions.
+        https://bugs.webkit.org/show_bug.cgi?id=83383
+
+        Reviewed by James Robinson.
+
+        * platform/chromium/compositing/video-frame-size-change.html: Added.
+        * platform/chromium/media/video-frame-size-change.html: Changed from dumpAsText() to pixel test
+
 2012-04-06  Dirk Pranke  <[email protected]>
 
         clone baselines from platform/win to platform/chromium-win

Added: trunk/LayoutTests/platform/chromium/compositing/video-frame-size-change.html (0 => 113536)


--- trunk/LayoutTests/platform/chromium/compositing/video-frame-size-change.html	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/compositing/video-frame-size-change.html	2012-04-07 02:04:32 UTC (rev 113536)
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+    <body _onload_="load()">
+        <p>Tests decoding and rendering a video element that has a changing resolution.</p>
+        <video width=320></video>
+        <video width=320></video>
+        <script>
+            if (window.layoutTestController) {
+                layoutTestController.waitUntilDone();
+            }
+
+            function load() {
+                var canplayCount = 0;
+                function oncanplay() {
+                    if (++canplayCount < 2) {
+                        return;
+                    }
+                    // Make sure we render the first frame.
+                    if (window.layoutTestController) {
+                        layoutTestController.display();
+                    }
+                    video.play();
+                };
+
+                // Get the first video to stay on frame zero for comparison purposes.
+                var video = document.getElementsByTagName("video")[0];
+                video.src = ""
+                video.addEventListener('canplay', oncanplay);
+
+                // Get the second video to play through the clip with changing dimensions.
+                video = document.getElementsByTagName("video")[1];
+                video.src = ""
+                video.addEventListener('canplay', oncanplay);
+
+                video.addEventListener('playing', function() {
+                    // Make sure the video plays for a bit.
+                    video.addEventListener('timeupdate', function() {
+                        if (video.currentTime > 1.0) {
+                            video.pause();
+                        }
+                    });
+                });
+
+                video.addEventListener('pause', function() {
+                    // Now seek back to a point where resolution should be different.
+                    video.addEventListener('seeked', function() {
+                        if (window.layoutTestController) {
+                            layoutTestController.notifyDone();
+                        }
+                    });
+
+                    video.currentTime = 0.5;
+                });
+            }
+        </script>
+   </body>
+</html>
Property changes on: trunk/LayoutTests/platform/chromium/compositing/video-frame-size-change.html
___________________________________________________________________

Added: svn:eol-style

Deleted: trunk/LayoutTests/platform/chromium/media/video-frame-size-change-expected.txt (113535 => 113536)


--- trunk/LayoutTests/platform/chromium/media/video-frame-size-change-expected.txt	2012-04-07 02:02:48 UTC (rev 113535)
+++ trunk/LayoutTests/platform/chromium/media/video-frame-size-change-expected.txt	2012-04-07 02:04:32 UTC (rev 113536)
@@ -1,26 +0,0 @@
-Test that a video element scales decoded frames to match the initial size as opposed to changing the size of the element.
-
-canplay
-canplay
-EXPECTED (1920 == '1920') OK
-EXPECTED (1080 == '1080') OK
-EXPECTED (1920 == '1920') OK
-EXPECTED (1080 == '1080') OK
-EXPECTED (320 == '320') OK
-EXPECTED (180 == '180') OK
-EXPECTED (1920 == '1920') OK
-EXPECTED (1080 == '1080') OK
-playing
-playing
-pause
-pause
-EXPECTED (1920 == '1920') OK
-EXPECTED (1080 == '1080') OK
-EXPECTED (1920 == '1920') OK
-EXPECTED (1080 == '1080') OK
-EXPECTED (320 == '320') OK
-EXPECTED (180 == '180') OK
-EXPECTED (1920 == '1920') OK
-EXPECTED (1080 == '1080') OK
-END OF TEST
-

Modified: trunk/LayoutTests/platform/chromium/media/video-frame-size-change.html (113535 => 113536)


--- trunk/LayoutTests/platform/chromium/media/video-frame-size-change.html	2012-04-07 02:02:48 UTC (rev 113535)
+++ trunk/LayoutTests/platform/chromium/media/video-frame-size-change.html	2012-04-07 02:04:32 UTC (rev 113536)
@@ -3,34 +3,32 @@
     <body _onload_="load()">
         <p>Test that a video element scales decoded frames to match the initial size
         as opposed to changing the size of the element.</p>
+        <video width="320"></video>
         <video></video>
-        <video width="320"></video>
 
-        <script src=""
         <script>
+            if (window.layoutTestController) {
+                layoutTestController.waitUntilDone();
+            }
+
             function load() {
-                var video = document.getElementsByTagName("video")[0];
-                var video_fixed_size = document.getElementsByTagName("video")[1];
+                var video = document.getElementsByTagName("video")[1];
+                var video_fixed_size = document.getElementsByTagName("video")[0];
                 video.src = ""
                 video_fixed_size.src = ""
 
                 var canplayCount = 0;
                 function oncanplay() {
-                    consoleWrite("canplay");
                     if (++canplayCount < 2) {
                         return;
                     }
 
-                    testExpected(video.clientWidth, 1920);
-                    testExpected(video.clientHeight, 1080);
-                    testExpected(video.videoWidth, 1920);
-                    testExpected(video.videoHeight, 1080);
+                    // Make sure we render the first frame.
+                    if (window.layoutTestController) {
+                        layoutTestController.display();
+                    }
+
                     video.play();
-
-                    testExpected(video_fixed_size.clientWidth, 320);
-                    testExpected(video_fixed_size.clientHeight, 180);
-                    testExpected(video_fixed_size.videoWidth, 1920);
-                    testExpected(video_fixed_size.videoHeight, 1080);
                     video_fixed_size.play();
                 };
                 video.addEventListener('canplay', oncanplay);
@@ -38,14 +36,13 @@
 
                 var playingCount = 0;
                 function onplaying() {
-                    consoleWrite("playing");
                     if (++playingCount < 2) {
                         return;
                     }
 
                     // Make sure both videos play for a bit.
                     function ontimeupdate(e) {
-                        if (e.target.currentTime > 0.5) {
+                        if (e.target.currentTime > 1.0) {
                             e.target.pause();
                         }
                     };
@@ -57,22 +54,26 @@
 
                 var pauseCount = 0;
                 function onpause() {
-                    consoleWrite("pause");
                     if (++pauseCount < 2) {
                         return;
                     }
 
-                    testExpected(video.clientWidth, 1920);
-                    testExpected(video.clientHeight, 1080);
-                    testExpected(video.videoWidth, 1920);
-                    testExpected(video.videoHeight, 1080);
+                    var seekedCount = 0;
+                    function onseeked() {
+                        if (++seekedCount < 2) {
+                            return;
+                        }
 
-                    testExpected(video_fixed_size.clientWidth, 320);
-                    testExpected(video_fixed_size.clientHeight, 180);
-                    testExpected(video_fixed_size.videoWidth, 1920);
-                    testExpected(video_fixed_size.videoHeight, 1080);
+                        if (window.layoutTestController) {
+                            layoutTestController.notifyDone();
+                        }
+                    }
 
-                    endTest();
+                    video.addEventListener('seeked', onseeked);
+                    video_fixed_size.addEventListener('seeked', onseeked);
+
+                    video.currentTime = 1.0;
+                    video_fixed_size.currentTime = 0.5;
                 };
                 video.addEventListener('pause', onpause);
                 video_fixed_size.addEventListener('pause', onpause);

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (113535 => 113536)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2012-04-07 02:02:48 UTC (rev 113535)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2012-04-07 02:04:32 UTC (rev 113536)
@@ -3840,3 +3840,6 @@
 BUGWK83391 DEBUG : http/tests/media/media-document.html = PASS CRASH
 
 BUGCR122462 WIN LINUX : http/tests/inspector/inspect-element.html = TEXT
+
+BUGWK83383 : platform/chromium/compositing/video-frame-size-change.html = MISSING
+BUGWK83383 : platform/chromium/media/video-frame-size-change.html = MISSING
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to