blob: fbbe8c5b13382dd00560589cd5768a3865407c52 [file] [log] [blame]
<!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="http://trac.webkit.org/changeset/185241">185241</a>: [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="../resources/non-animated.gif">
</div>
<br>
<div>
Tap "Choose File," and select the image from your photo library:
<input type="file" onchange="runTest(this)">
</div>
</body>
</html>