Title: [203777] trunk
Revision
203777
Author
[email protected]
Date
2016-07-27 09:00:16 -0700 (Wed, 27 Jul 2016)

Log Message

[GTK] Fix some video/canvas tests that should be passing
https://bugs.webkit.org/show_bug.cgi?id=160023

Patch by Miguel Gomez <[email protected]> on 2016-07-27
Reviewed by Carlos Garcia Campos.

Tools:

Add a platform identifier to the TestRunner's page user agent when the tests are run on the
EFL or GTK platforms.

* WebKitTestRunner/efl/TestControllerEfl.cpp:
(WTR::TestController::platformConfigureViewForTest):
* WebKitTestRunner/gtk/TestControllerGtk.cpp:
(WTR::TestController::platformConfigureViewForTest):

LayoutTests:

Modify the tests to use a tolerance of 6 when running on the GTK or EFL platforms. Also,
added new expectations for the tests that need them.

* fast/canvas/canvas-createPattern-video-loading.html:
* fast/canvas/canvas-createPattern-video-modify.html:
* media/video-canvas-createPattern.html:
* platform/efl/fast/canvas/canvas-createPattern-video-loading-expected.txt: Added.
* platform/efl/fast/canvas/canvas-createPattern-video-modify-expected.txt: Added.
* platform/gtk/fast/canvas/canvas-createPattern-video-loading-expected.txt: Added.
* platform/gtk/fast/canvas/canvas-createPattern-video-modify-expected.txt: Added.
* resources/platform-helper.js: Added.
(isGtk):
(isEfl):
(videoCanvasPixelComparisonTolerance):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (203776 => 203777)


--- trunk/LayoutTests/ChangeLog	2016-07-27 15:58:08 UTC (rev 203776)
+++ trunk/LayoutTests/ChangeLog	2016-07-27 16:00:16 UTC (rev 203777)
@@ -1,3 +1,25 @@
+2016-07-27  Miguel Gomez  <[email protected]>
+
+        [GTK] Fix some video/canvas tests that should be passing
+        https://bugs.webkit.org/show_bug.cgi?id=160023
+
+        Reviewed by Carlos Garcia Campos.
+
+        Modify the tests to use a tolerance of 6 when running on the GTK or EFL platforms. Also,
+        added new expectations for the tests that need them.
+
+        * fast/canvas/canvas-createPattern-video-loading.html:
+        * fast/canvas/canvas-createPattern-video-modify.html:
+        * media/video-canvas-createPattern.html:
+        * platform/efl/fast/canvas/canvas-createPattern-video-loading-expected.txt: Added.
+        * platform/efl/fast/canvas/canvas-createPattern-video-modify-expected.txt: Added.
+        * platform/gtk/fast/canvas/canvas-createPattern-video-loading-expected.txt: Added.
+        * platform/gtk/fast/canvas/canvas-createPattern-video-modify-expected.txt: Added.
+        * resources/platform-helper.js: Added.
+        (isGtk):
+        (isEfl):
+        (videoCanvasPixelComparisonTolerance):
+
 2016-07-27  Romain Bellessort  <[email protected]>
 
         [Streams API] Replace ReadableStreamReader by ReadableStreamDefaultReader

Modified: trunk/LayoutTests/fast/canvas/canvas-createPattern-video-loading.html (203776 => 203777)


--- trunk/LayoutTests/fast/canvas/canvas-createPattern-video-loading.html	2016-07-27 15:58:08 UTC (rev 203776)
+++ trunk/LayoutTests/fast/canvas/canvas-createPattern-video-loading.html	2016-07-27 16:00:16 UTC (rev 203777)
@@ -3,6 +3,7 @@
 <head>
     <script src=""
     <script src=""
+    <script src=""
 </head>
 <body>
 <script>
@@ -58,7 +59,7 @@
         context.fillRect(0, 0, canvas.width, canvas.height);
 
         expectedResults.forEach(function(element) {
-            checkPixels(context, element[0], element[1], element[2], element[3], element[4], 2);
+            checkPixels(context, element[0], element[1], element[2], element[3], element[4], videoCanvasPixelComparisonTolerance());
         });
     }
 

Modified: trunk/LayoutTests/fast/canvas/canvas-createPattern-video-modify.html (203776 => 203777)


--- trunk/LayoutTests/fast/canvas/canvas-createPattern-video-modify.html	2016-07-27 15:58:08 UTC (rev 203776)
+++ trunk/LayoutTests/fast/canvas/canvas-createPattern-video-modify.html	2016-07-27 16:00:16 UTC (rev 203777)
@@ -3,6 +3,7 @@
 <head>
     <script src=""
     <script src=""
+    <script src=""
 </head>
 <body>
 <script>
@@ -40,7 +41,7 @@
             context.fillRect(0, 0, canvas.width, canvas.height);
 
             expectedResults.forEach(function(element) {
-                checkPixels(context, element[0], element[1], element[2], element[3], element[4], 2);
+                checkPixels(context, element[0], element[1], element[2], element[3], element[4], videoCanvasPixelComparisonTolerance());
             });
 
             finishJSTest();

Modified: trunk/LayoutTests/media/video-canvas-createPattern.html (203776 => 203777)


--- trunk/LayoutTests/media/video-canvas-createPattern.html	2016-07-27 15:58:08 UTC (rev 203776)
+++ trunk/LayoutTests/media/video-canvas-createPattern.html	2016-07-27 16:00:16 UTC (rev 203777)
@@ -3,6 +3,7 @@
         <title>Create patterns on canvas using video</title>
         <script src=""
         <script src=""
+        <script src=""
         <script>
             var video;
             var numberOfSeeks = 4;
@@ -52,7 +53,7 @@
                 document.getElementById('canvases').appendChild(canvas);
 
                 expectedResults.forEach(function(element) {
-                    checkColorAtLocation(ctx, element[0], element[1], element[2], element[3], element[4], 2);
+                    checkColorAtLocation(ctx, element[0], element[1], element[2], element[3], element[4], videoCanvasPixelComparisonTolerance());
                 });
 
                 // Ensure that the test seeks a couple of times.

Added: trunk/LayoutTests/platform/efl/fast/canvas/canvas-createPattern-video-loading-expected.txt (0 => 203777)


--- trunk/LayoutTests/platform/efl/fast/canvas/canvas-createPattern-video-loading-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/efl/fast/canvas/canvas-createPattern-video-loading-expected.txt	2016-07-27 16:00:16 UTC (rev 203777)
@@ -0,0 +1,82 @@
+Test the behavior of 2d canvas createPattern as a video is loaded
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.createElement('canvas').getContext('2d').createPattern(video, 'repeat') is null
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/efl/fast/canvas/canvas-createPattern-video-modify-expected.txt (0 => 203777)


--- trunk/LayoutTests/platform/efl/fast/canvas/canvas-createPattern-video-modify-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/efl/fast/canvas/canvas-createPattern-video-modify-expected.txt	2016-07-27 16:00:16 UTC (rev 203777)
@@ -0,0 +1,21 @@
+Tests that modifying the video used in createPattern does not affect the pattern rendered.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/gtk/fast/canvas/canvas-createPattern-video-loading-expected.txt (0 => 203777)


--- trunk/LayoutTests/platform/gtk/fast/canvas/canvas-createPattern-video-loading-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/canvas/canvas-createPattern-video-loading-expected.txt	2016-07-27 16:00:16 UTC (rev 203777)
@@ -0,0 +1,82 @@
+Test the behavior of 2d canvas createPattern as a video is loaded
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.createElement('canvas').getContext('2d').createPattern(video, 'repeat') is null
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 17
+PASS buffer[1] is within 6 of 197
+PASS buffer[2] is within 6 of 195
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS buffer[0] is within 6 of 20
+PASS buffer[1] is within 6 of 200
+PASS buffer[2] is within 6 of 18
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/gtk/fast/canvas/canvas-createPattern-video-modify-expected.txt (0 => 203777)


--- trunk/LayoutTests/platform/gtk/fast/canvas/canvas-createPattern-video-modify-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/canvas/canvas-createPattern-video-modify-expected.txt	2016-07-27 16:00:16 UTC (rev 203777)
@@ -0,0 +1,21 @@
+Tests that modifying the video used in createPattern does not affect the pattern rendered.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS buffer[0] is within 6 of 194
+PASS buffer[1] is within 6 of 193
+PASS buffer[2] is within 6 of 14
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/resources/platform-helper.js (0 => 203777)


--- trunk/LayoutTests/resources/platform-helper.js	                        (rev 0)
+++ trunk/LayoutTests/resources/platform-helper.js	2016-07-27 16:00:16 UTC (rev 203777)
@@ -0,0 +1,17 @@
+function isGtk()
+{
+    return navigator.userAgent.includes("WebKitTestRunnerGTK");
+}
+
+function isEfl()
+{
+    return navigator.userAgent.includes("WebKitTestRunnerEFL");
+}
+
+function videoCanvasPixelComparisonTolerance()
+{
+    if (isGtk() || isEfl())
+        return 6;
+
+    return 2;
+}

Modified: trunk/Tools/ChangeLog (203776 => 203777)


--- trunk/Tools/ChangeLog	2016-07-27 15:58:08 UTC (rev 203776)
+++ trunk/Tools/ChangeLog	2016-07-27 16:00:16 UTC (rev 203777)
@@ -1,3 +1,18 @@
+2016-07-27  Miguel Gomez  <[email protected]>
+
+        [GTK] Fix some video/canvas tests that should be passing
+        https://bugs.webkit.org/show_bug.cgi?id=160023
+
+        Reviewed by Carlos Garcia Campos.
+
+        Add a platform identifier to the TestRunner's page user agent when the tests are run on the
+        EFL or GTK platforms.
+
+        * WebKitTestRunner/efl/TestControllerEfl.cpp:
+        (WTR::TestController::platformConfigureViewForTest):
+        * WebKitTestRunner/gtk/TestControllerGtk.cpp:
+        (WTR::TestController::platformConfigureViewForTest):
+
 2016-07-27  Carlos Alberto Lopez Perez  <[email protected]>
 
         [Tools] The built product doesn't contains the dwo files when DEBUG_FISSION is enabled.

Modified: trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp (203776 => 203777)


--- trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp	2016-07-27 15:58:08 UTC (rev 203776)
+++ trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp	2016-07-27 16:00:16 UTC (rev 203777)
@@ -156,6 +156,7 @@
 
 void TestController::platformConfigureViewForTest(const TestInvocation&)
 {
+    WKPageSetApplicationNameForUserAgent(mainWebView()->page(), WKStringCreateWithUTF8CString("WebKitTestRunnerEFL"));
 }
 
 void TestController::platformResetPreferencesToConsistentValues()

Modified: trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp (203776 => 203777)


--- trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp	2016-07-27 15:58:08 UTC (rev 203776)
+++ trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp	2016-07-27 16:00:16 UTC (rev 203777)
@@ -140,6 +140,7 @@
 
 void TestController::platformConfigureViewForTest(const TestInvocation&)
 {
+    WKPageSetApplicationNameForUserAgent(mainWebView()->page(), WKStringCreateWithUTF8CString("WebKitTestRunnerGTK"));
 }
 
 void TestController::platformResetPreferencesToConsistentValues()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to