Title: [189410] trunk
Revision
189410
Author
[email protected]
Date
2015-09-04 17:58:37 -0700 (Fri, 04 Sep 2015)

Log Message

[iOS] Need a test for bug #145539: Uploading an animated GIF from the
photo library uploads a JPEG
https://bugs.webkit.org/show_bug.cgi?id=148849

Reviewed by Daniel Bates.

* ManualTests/ios/image-file-uploads-as-original-type.html: Added.
On the Mac, file upload tests use EventSender::beginDragWithFiles. This
functionality doesn't exist on iOS, so we'll add a manual test.
This tests that the first few bytes of the selected file are "GIF".

Modified Paths

Added Paths

Diff

Modified: trunk/ChangeLog (189409 => 189410)


--- trunk/ChangeLog	2015-09-05 00:46:06 UTC (rev 189409)
+++ trunk/ChangeLog	2015-09-05 00:58:37 UTC (rev 189410)
@@ -1,3 +1,16 @@
+2015-09-04  Jon Honeycutt  <[email protected]>
+
+        [iOS] Need a test for bug #145539: Uploading an animated GIF from the
+        photo library uploads a JPEG
+        https://bugs.webkit.org/show_bug.cgi?id=148849
+
+        Reviewed by Daniel Bates.
+
+        * ManualTests/ios/image-file-uploads-as-original-type.html: Added.
+        On the Mac, file upload tests use EventSender::beginDragWithFiles. This
+        functionality doesn't exist on iOS, so we'll add a manual test.
+        This tests that the first few bytes of the selected file are "GIF".
+
 2015-09-04  Carlos Alberto Lopez Perez  <[email protected]>
 
         Follow-up patch for r189343.

Added: trunk/ManualTests/ios/image-file-uploads-as-original-type.html (0 => 189410)


--- trunk/ManualTests/ios/image-file-uploads-as-original-type.html	                        (rev 0)
+++ trunk/ManualTests/ios/image-file-uploads-as-original-type.html	2015-09-05 00:58:37 UTC (rev 189410)
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <script>
+            const GIFSignature = "GIF89a";
+
+            function runTest(fileControl) {
+                var reader = new FileReader();
+                reader._onload_ = function(e) {
+                    var arrayBuffer = reader.result;
+                    if (!arrayBuffer || arrayBuffer.byteLength < GIFSignature.length) {
+                        document.getElementById("console").textContent = "TEST FAILED. Failed to get array buffer for file.";
+                        return;
+                    }
+                    var view = new Uint8Array(arrayBuffer, 0, GIFSignature.length);
+                    var signature = Array.prototype.map.call(view, function(value) { return String.fromCharCode(value); }).join('');
+                    if (signature !== GIFSignature) {
+                        document.getElementById("console").textContent = "TEST FAILED. File was not of correct type.";
+                        return;
+                    }
+                    document.getElementById("console").textContent = "TEST PASSED";
+                }
+                reader.readAsArrayBuffer(fileControl.files[0]);
+            }
+        </script>
+    </head>
+    <body>
+        <div>
+            This is a test for Bug #<a href="" [iOS] Uploading an animated GIF from the photo library uploads a JPEG.
+            <br><br>
+            This test should be run on iOS. If the test passes, TEST PASSED will appear below.
+            <br><br>
+            <div id="console">Waiting on test to complete...</div>
+            <br><br>
+        </div>
+        <div>
+            Long-press on this image, and save it to your photo library:
+            <img src=""
+        </div>
+        <br>
+        <div>
+            Tap "Choose File," and select the image from your photo library:
+            <input type="file" _onchange_="runTest(this)">
+        </div>
+    </body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to