<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[168908] trunk/LayoutTests</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/168908">168908</a></dd>
<dt>Author</dt> <dd>ap@apple.com</dd>
<dt>Date</dt> <dd>2014-05-15 13:58:32 -0700 (Thu, 15 May 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Automatically zip document bundles used via File API
https://bugs.webkit.org/show_bug.cgi?id=132713
<rdar://problem/13397892>
Actually land the tests.
* fast/files/filereader-zip-bundle-expected.txt: Added.
* fast/files/filereader-zip-bundle.html: Added.
* fast/files/resources/document.rtfd: Added.
* fast/files/resources/document.rtfd/TXT.rtf: Added.
* http/tests/local/fileapi/resources/document.rtfd: Added.
* http/tests/local/fileapi/resources/document.rtfd/TXT.rtf: Added.
* http/tests/local/fileapi/upload-zip-bundle-as-blob-expected.txt: Added.
* http/tests/local/fileapi/upload-zip-bundle-as-blob.html: Added.
* platform/wk2/TestExpectations:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformwk2TestExpectations">trunk/LayoutTests/platform/wk2/TestExpectations</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastfilesfilereaderzipbundleexpectedtxt">trunk/LayoutTests/fast/files/filereader-zip-bundle-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastfilesfilereaderzipbundlehtml">trunk/LayoutTests/fast/files/filereader-zip-bundle.html</a></li>
<li>trunk/LayoutTests/fast/files/resources/document.rtfd/</li>
<li><a href="#trunkLayoutTestsfastfilesresourcesdocumentrtfdTXTrtf">trunk/LayoutTests/fast/files/resources/document.rtfd/TXT.rtf</a></li>
<li>trunk/LayoutTests/http/tests/local/fileapi/resources/document.rtfd/</li>
<li><a href="#trunkLayoutTestshttptestslocalfileapiresourcesdocumentrtfdTXTrtf">trunk/LayoutTests/http/tests/local/fileapi/resources/document.rtfd/TXT.rtf</a></li>
<li><a href="#trunkLayoutTestshttptestslocalfileapiuploadzipbundleasblobexpectedtxt">trunk/LayoutTests/http/tests/local/fileapi/upload-zip-bundle-as-blob-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestslocalfileapiuploadzipbundleasblobhtml">trunk/LayoutTests/http/tests/local/fileapi/upload-zip-bundle-as-blob.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (168907 => 168908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-05-15 20:03:27 UTC (rev 168907)
+++ trunk/LayoutTests/ChangeLog        2014-05-15 20:58:32 UTC (rev 168908)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-05-15 Alexey Proskuryakov <ap@apple.com>
+
+ Automatically zip document bundles used via File API
+ https://bugs.webkit.org/show_bug.cgi?id=132713
+ <rdar://problem/13397892>
+
+ Actually land the tests.
+
+ * fast/files/filereader-zip-bundle-expected.txt: Added.
+ * fast/files/filereader-zip-bundle.html: Added.
+ * fast/files/resources/document.rtfd: Added.
+ * fast/files/resources/document.rtfd/TXT.rtf: Added.
+ * http/tests/local/fileapi/resources/document.rtfd: Added.
+ * http/tests/local/fileapi/resources/document.rtfd/TXT.rtf: Added.
+ * http/tests/local/fileapi/upload-zip-bundle-as-blob-expected.txt: Added.
+ * http/tests/local/fileapi/upload-zip-bundle-as-blob.html: Added.
+ * platform/wk2/TestExpectations:
+
</ins><span class="cx"> 2014-05-15 Mark Hahnenberg <mhahnenberg@apple.com>
</span><span class="cx">
</span><span class="cx"> Move subframe name getter lookup later in JSDOMWindow::getOwnPropertySlot
</span></span></pre></div>
<a id="trunkLayoutTestsfastfilesfilereaderzipbundleexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/files/filereader-zip-bundle-expected.txt (0 => 168908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/files/filereader-zip-bundle-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/files/filereader-zip-bundle-expected.txt        2014-05-15 20:58:32 UTC (rev 168908)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Test that bundles are automatically zipped when accessed via FileReader. To test manually, please drag a file bundle to a "Choose File" input below.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS file.size > 400 is true
+PASS reader.result is 'PK'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/files/filereader-zip-bundle-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastfilesfilereaderzipbundlehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/files/filereader-zip-bundle.html (0 => 168908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/files/filereader-zip-bundle.html         (rev 0)
+++ trunk/LayoutTests/fast/files/filereader-zip-bundle.html        2014-05-15 20:58:32 UTC (rev 168908)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<div id=description></div>
+<input type=file id=dropTarget></div>
+<div id=console></div>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+description("Test that bundles are automatically zipped when accessed via FileReader. To test manually, please drag a file bundle to a \"Choose File\" input below.");
+jsTestIsAsync = true;
+
+window.onload = function()
+{
+ var dropTarget = document.getElementById("dropTarget");
+
+ dropTarget.addEventListener("drop", ondrop, true);
+ dropTarget.addEventListener("click", function() { event.preventDefault(); }, true);
+
+ if (!window.eventSender)
+ return;
+
+ var endX = dropTarget.offsetLeft + dropTarget.offsetWidth / 2;
+ var endY = dropTarget.offsetTop + dropTarget.offsetHeight / 2
+
+ eventSender.beginDragWithFiles(["resources/document.rtfd"]);
+ eventSender.mouseMoveTo(endX, endY);
+ eventSender.mouseUp();
+}
+
+function ondrop(event)
+{
+ file = event.dataTransfer.files.item(0);
+ // We used to report 102 for the size of this file, which presumably was directory node size.
+ // Archive is 528 bytes on a system I test with.
+ shouldBeTrue("file.size > 400");
+ reader = new FileReader;
+ reader.readAsText(file.slice(0, 2));
+ reader.onloadend = function() {
+ shouldBe("reader.result", "'PK'");
+ finishJSTest();
+ }
+}
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/files/filereader-zip-bundle.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsfastfilesresourcesdocumentrtfdTXTrtf"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/files/resources/document.rtfd/TXT.rtf (0 => 168908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/files/resources/document.rtfd/TXT.rtf         (rev 0)
+++ trunk/LayoutTests/fast/files/resources/document.rtfd/TXT.rtf        2014-05-15 20:58:32 UTC (rev 168908)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+{\rtf1\ansi\ansicpg1251\cocoartf1265\cocoasubrtf200
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\margl1440\margr1440\vieww10800\viewh8400\viewkind0
+\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
+
+\f0\fs24 \cf0 Hello, world!}
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/LayoutTests/fast/files/resources/document.rtfd/TXT.rtf
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestslocalfileapiresourcesdocumentrtfdTXTrtf"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/local/fileapi/resources/document.rtfd/TXT.rtf (0 => 168908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/local/fileapi/resources/document.rtfd/TXT.rtf         (rev 0)
+++ trunk/LayoutTests/http/tests/local/fileapi/resources/document.rtfd/TXT.rtf        2014-05-15 20:58:32 UTC (rev 168908)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+{\rtf1\ansi\ansicpg1251\cocoartf1265\cocoasubrtf200
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\margl1440\margr1440\vieww10800\viewh8400\viewkind0
+\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
+
+\f0\fs24 \cf0 Hello, world!}
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/LayoutTests/http/tests/local/fileapi/resources/document.rtfd/TXT.rtf
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestslocalfileapiuploadzipbundleasblobexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/local/fileapi/upload-zip-bundle-as-blob-expected.txt (0 => 168908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/local/fileapi/upload-zip-bundle-as-blob-expected.txt         (rev 0)
+++ trunk/LayoutTests/http/tests/local/fileapi/upload-zip-bundle-as-blob-expected.txt        2014-05-15 20:58:32 UTC (rev 168908)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Test that bundles are automatically zipped when uploaded with XMLHttpRequest. To test manually, please drag a file bundle to a "Choose File" input below.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS String.fromCharCode(responseArray[0], responseArray[1]) is 'PK'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/http/tests/local/fileapi/upload-zip-bundle-as-blob-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestshttptestslocalfileapiuploadzipbundleasblobhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/local/fileapi/upload-zip-bundle-as-blob.html (0 => 168908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/local/fileapi/upload-zip-bundle-as-blob.html         (rev 0)
+++ trunk/LayoutTests/http/tests/local/fileapi/upload-zip-bundle-as-blob.html        2014-05-15 20:58:32 UTC (rev 168908)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<div id=description></div>
+<input type=file id=dropTarget></div>
+<div id=console></div>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+description("Test that bundles are automatically zipped when uploaded with XMLHttpRequest. To test manually, please drag a file bundle to a \"Choose File\" input below.");
+jsTestIsAsync = true;
+
+window.onload = function()
+{
+ var dropTarget = document.getElementById("dropTarget");
+
+ dropTarget.addEventListener("drop", ondrop, true);
+ dropTarget.addEventListener("click", function() { event.preventDefault(); }, true);
+
+ if (!window.eventSender)
+ return;
+
+ var endX = dropTarget.offsetLeft + dropTarget.offsetWidth / 2;
+ var endY = dropTarget.offsetTop + dropTarget.offsetHeight / 2
+ eventSender.beginDragWithFiles(["resources/document.rtfd"]);
+ eventSender.mouseMoveTo(endX, endY);
+ eventSender.mouseUp();
+}
+
+function ondrop(event)
+{
+ event.preventDefault();
+ var file = event.dataTransfer.files.item(0);
+ var xhr = new XMLHttpRequest;
+ xhr.open("POST", "http://127.0.0.1:8000/xmlhttprequest/resources/post-echo.cgi", true);
+ xhr.responseType = "arraybuffer";
+ xhr.send(file);
+ xhr.onloadend = function() {
+ responseArray = new Uint8Array(xhr.response);
+ shouldBe("String.fromCharCode(responseArray[0], responseArray[1])", "'PK'");
+ finishJSTest();
+ }
+}
+</script>
+<script src="../../../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins><span class="cx">Property changes on: trunk/LayoutTests/http/tests/local/fileapi/upload-zip-bundle-as-blob.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/wk2/TestExpectations (168907 => 168908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wk2/TestExpectations        2014-05-15 20:03:27 UTC (rev 168907)
+++ trunk/LayoutTests/platform/wk2/TestExpectations        2014-05-15 20:58:32 UTC (rev 168908)
</span><span class="lines">@@ -662,6 +662,7 @@
</span><span class="cx"> fast/files/file-reader-abort.html
</span><span class="cx"> fast/files/file-reader-directory-crash.html
</span><span class="cx"> fast/files/file-reader-event-listener.html
</span><ins>+fast/files/filereader-zip-bundle.html
</ins><span class="cx"> fast/files/local-file-drag-security.html
</span><span class="cx"> fast/files/null-origin-string.html
</span><span class="cx"> fast/files/read-blob-async.html
</span><span class="lines">@@ -681,6 +682,7 @@
</span><span class="cx"> http/tests/local/fileapi/file-last-modified-after-delete.html
</span><span class="cx"> http/tests/local/fileapi/file-last-modified.html
</span><span class="cx"> http/tests/local/fileapi/send-dragged-file.html
</span><ins>+http/tests/local/fileapi/upload-zip-bundle-as-blob.html
</ins><span class="cx"> http/tests/local/formdata/form-data-with-unknown-file-extension.html
</span><span class="cx"> http/tests/local/formdata/send-form-data-constructed-from-form.html
</span><span class="cx"> http/tests/local/formdata/send-form-data-with-filename.html
</span></span></pre>
</div>
</div>
</body>
</html>