Title: [135444] trunk/LayoutTests
Revision
135444
Author
commit-qu...@webkit.org
Date
2012-11-21 15:30:34 -0800 (Wed, 21 Nov 2012)

Log Message

Multi-frame CUR file test hangs on mac port
https://bugs.webkit.org/show_bug.cgi?id=101811

Patch by Rick Byers <rby...@chromium.org> on 2012-11-21
Reviewed by Alexey Proskuryakov.

Fix tests to not hang on unexpected image load failure.
Expect multi-frame CUR files to fail to load on Mac.

* fast/events/mouse-cursor.html:
* fast/events/mouse-cursor-multiframecur.html:
* platform/mac/TestExpectations:
* platform/mac/fast/events/mouse-cursor-multiframecur-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (135443 => 135444)


--- trunk/LayoutTests/ChangeLog	2012-11-21 23:21:41 UTC (rev 135443)
+++ trunk/LayoutTests/ChangeLog	2012-11-21 23:30:34 UTC (rev 135444)
@@ -1,3 +1,18 @@
+2012-11-21  Rick Byers  <rby...@chromium.org>
+
+        Multi-frame CUR file test hangs on mac port 
+        https://bugs.webkit.org/show_bug.cgi?id=101811
+
+        Reviewed by Alexey Proskuryakov.
+
+        Fix tests to not hang on unexpected image load failure.
+        Expect multi-frame CUR files to fail to load on Mac.
+
+        * fast/events/mouse-cursor.html:
+        * fast/events/mouse-cursor-multiframecur.html:
+        * platform/mac/TestExpectations:
+        * platform/mac/fast/events/mouse-cursor-multiframecur-expected.txt: Added.
+
 2012-11-21  Tien-Ren Chen  <trc...@chromium.org>
 
         Invalidate non-composited content host when page scale factor changes

Modified: trunk/LayoutTests/fast/events/mouse-cursor-multiframecur.html (135443 => 135444)


--- trunk/LayoutTests/fast/events/mouse-cursor-multiframecur.html	2012-11-21 23:21:41 UTC (rev 135443)
+++ trunk/LayoutTests/fast/events/mouse-cursor-multiframecur.html	2012-11-21 23:30:34 UTC (rev 135444)
@@ -7,7 +7,7 @@
 </head>
 <body>
 <p id="description"></p>
-<p><a href="" 100059</a></p>
+<p><a href="" 100059</a></p>
 <div id="test-container">
   <div>Implicit default cursor</div>
   <div style='cursor: url(resources/greenbox-3frames.cur), pointer'>CUR file with 3 frames, largest of which (2nd frame) is 20x12 with hotspot at (18,11).</div>
@@ -17,25 +17,28 @@
 <script>
 var imagesLeftToLoad = 0;
 
-function onImageLoad(e) {
+function onImageLoad(success, path, e) {
 
-    // This debug output is non-deterministic and contains absolute URLs - only show when
-    // not running in DRT
+    // This debug output order is non-deterministic - only show when not running in DRT
     if (!window.testRunner)
-        debug( 'Event "' + e.type + '": ' + e.target.src);
+        debug( 'Event "' + e.type + '": ' + path);
         
     imagesLeftToLoad--;
+    
+    if (!success) {
+        // Note that on the Mac port, CUR files are loaded using CoreGraphics, and it doesn't
+        // appear to support multi-frame CUR files, so the load will fail in this case.
+        // We explicitly look for this behavior on Mac so that if it ever starts being supported,
+        // we can ensure the behavior is consistent with the other ports.
+        testFailed('Got unexpected \'' + e.type + '\' event for image: ' + path); 
+    }
+
     if (imagesLeftToLoad == 0)
         runTests();
     if (imagesLeftToLoad < 0)
         testFailed('Got more load/error callback than expected.');
 }
 
-function onImageUnexpected(e) {
-	imagesLeftToLoad--;
-    testFailed('Got unexpected \'' + e.type + '\' event for image: ' + e.target.src); 
-}
-
 function runTests() {
     // Can't do anything useful here without eventSender
     if (window.eventSender) {
@@ -82,9 +85,10 @@
 for (var i = 0; i < imagesToLoad.length; i++) {
     var img = new Image();
     var expectError = imagesToLoad[i].error; 
-    img.addEventListener('load', expectError ? onImageUnexpected : onImageLoad);
-    img.addEventListener('error', expectError ? onImageLoad : onImageUnexpected);
-    img.src = ""
+    var url = ""
+    img.addEventListener('load', onImageLoad.bind(undefined, !expectError, url));
+    img.addEventListener('error', onImageLoad.bind(undefined, expectError, url));
+    img.src = ""
 }
 
 </script>

Modified: trunk/LayoutTests/fast/events/mouse-cursor.html (135443 => 135444)


--- trunk/LayoutTests/fast/events/mouse-cursor.html	2012-11-21 23:21:41 UTC (rev 135443)
+++ trunk/LayoutTests/fast/events/mouse-cursor.html	2012-11-21 23:30:34 UTC (rev 135444)
@@ -44,12 +44,15 @@
 <script>
 var imagesLeftToLoad = 0;
 
-function onImageLoad(e) {
+function onImageLoad(success, e) {
 
     // This debug output is non-deterministic and contains absolute URLs - only show when
     // not running in DRT
     if (!window.testRunner)
         debug( 'Event "' + e.type + '": ' + e.target.src);
+    
+    if (!success)
+        testFailed('Got unexpected \'' + e.type + '\' event for image: ' + e.target.src); 
         
     imagesLeftToLoad--;
     if (imagesLeftToLoad == 0)
@@ -58,11 +61,6 @@
         testFailed('Got more load/error callback than expected.');
 }
 
-function onImageUnexpected(e) {
-	imagesLeftToLoad--;
-    testFailed('Got unexpected \'' + e.type + '\' event for image: ' + e.target.src); 
-}
-
 function runTests() {
     // Can't do anything useful here without eventSender
     if (window.eventSender) {
@@ -117,8 +115,8 @@
 for (var i = 0; i < imagesToLoad.length; i++) {
     var img = new Image();
     var expectError = imagesToLoad[i].error; 
-    img.addEventListener('load', expectError ? onImageUnexpected : onImageLoad);
-    img.addEventListener('error', expectError ? onImageLoad : onImageUnexpected);
+    img.addEventListener('load', onImageLoad.bind(undefined, !expectError));
+    img.addEventListener('error', onImageLoad.bind(undefined, expectError));
     img.src = ""
 }
 

Modified: trunk/LayoutTests/platform/mac/TestExpectations (135443 => 135444)


--- trunk/LayoutTests/platform/mac/TestExpectations	2012-11-21 23:21:41 UTC (rev 135443)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2012-11-21 23:30:34 UTC (rev 135444)
@@ -1190,6 +1190,3 @@
 
 # Mountain Lion and prior do not support custom media data loading
 Bug(jernoble) [ MountainLion Lion SnowLeopard ] media/video-src-blob.html
-
-# Hangs safari apparently due to an issue with weird multi-frame CUR image files
-webkit.org/b/101811 fast/events/mouse-cursor-multiframecur.html [ Skip ]

Added: trunk/LayoutTests/platform/mac/fast/events/mouse-cursor-multiframecur-expected.txt (0 => 135444)


--- trunk/LayoutTests/platform/mac/fast/events/mouse-cursor-multiframecur-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/events/mouse-cursor-multiframecur-expected.txt	2012-11-21 23:30:34 UTC (rev 135444)
@@ -0,0 +1,19 @@
+Test that mouse cursors are applied correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Bug 100059
+
+
+FAIL Got unexpected 'error' event for image: resources/greenbox-3frames.cur
+TEST CASE: Implicit default cursor
+Cursor Info: type=IBeam hotSpot=0,0
+
+TEST CASE: CUR file with 3 frames, largest of which (2nd frame) is 20x12 with hotspot at (18,11).
+Cursor Info: type=Hand hotSpot=0,0
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to