Unreviewed, rolling out r145097.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2013 20:59:42 +0000 (20:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2013 20:59:42 +0000 (20:59 +0000)
http://trac.webkit.org/changeset/145097
https://bugs.webkit.org/show_bug.cgi?id=111765

Triggers an ASSERT in the Chromium port (Requested by abarth
on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-03-07

Source/WebCore:

* html/FileInputType.cpp:
(WebCore::FileInputType::appendFormData):
* platform/network/FormData.cpp:
(WebCore::FormData::appendKeyValuePairItems):

LayoutTests:

* http/tests/local/formdata/send-form-data-with-empty-blob-filename-expected.txt: Removed.
* http/tests/local/formdata/send-form-data-with-empty-blob-filename.html: Removed.
* http/tests/local/formdata/send-form-data-with-empty-file-filename-expected.txt: Removed.
* http/tests/local/formdata/send-form-data-with-empty-file-filename.html: Removed.
* http/tests/xmlhttprequest/resources/multipart-post-echo-filenames.php: Removed.
* platform/wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145123 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/local/formdata/send-form-data-with-empty-blob-filename-expected.txt [deleted file]
LayoutTests/http/tests/local/formdata/send-form-data-with-empty-blob-filename.html [deleted file]
LayoutTests/http/tests/local/formdata/send-form-data-with-empty-file-filename-expected.txt [deleted file]
LayoutTests/http/tests/local/formdata/send-form-data-with-empty-file-filename.html [deleted file]
LayoutTests/http/tests/xmlhttprequest/resources/multipart-post-echo-filenames.php [deleted file]
LayoutTests/platform/wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/html/FileInputType.cpp
Source/WebCore/platform/network/FormData.cpp

index 9c9f9e2..529bd47 100644 (file)
@@ -1,3 +1,19 @@
+2013-03-07  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r145097.
+        http://trac.webkit.org/changeset/145097
+        https://bugs.webkit.org/show_bug.cgi?id=111765
+
+        Triggers an ASSERT in the Chromium port (Requested by abarth
+        on #webkit).
+
+        * http/tests/local/formdata/send-form-data-with-empty-blob-filename-expected.txt: Removed.
+        * http/tests/local/formdata/send-form-data-with-empty-blob-filename.html: Removed.
+        * http/tests/local/formdata/send-form-data-with-empty-file-filename-expected.txt: Removed.
+        * http/tests/local/formdata/send-form-data-with-empty-file-filename.html: Removed.
+        * http/tests/xmlhttprequest/resources/multipart-post-echo-filenames.php: Removed.
+        * platform/wk2/TestExpectations:
+
 2013-03-07  Ojan Vafai  <ojan@chromium.org>
 
         Image rebaselines after r145104.
diff --git a/LayoutTests/http/tests/local/formdata/send-form-data-with-empty-blob-filename-expected.txt b/LayoutTests/http/tests/local/formdata/send-form-data-with-empty-blob-filename-expected.txt
deleted file mode 100644 (file)
index f44261e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-Test that filename passed to FormData.append() takes precedence over default Blob filename 'blob', even if empty.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Sending FormData containing one blob with custom empty filename:
-PASS filename is ''
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/http/tests/local/formdata/send-form-data-with-empty-blob-filename.html b/LayoutTests/http/tests/local/formdata/send-form-data-with-empty-blob-filename.html
deleted file mode 100644 (file)
index a01b0e0..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../../../fast/js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script>
-description("Test that filename passed to FormData.append() takes precedence over default Blob filename 'blob', even if empty.");
-
-self.jsTestIsAsync = true;
-
-function runTest()
-{
-    debug("Sending FormData containing one blob with custom empty filename:");
-
-    var formData = new FormData;
-    formData.append("blob", new Blob([""]), "");
-    var xhr = new XMLHttpRequest();
-    xhr.open("POST", "http://127.0.0.1:8000/xmlhttprequest/resources/multipart-post-echo-filenames.php", true);
-    xhr.onload = function() {
-        filename = xhr.responseText;
-        shouldBe("filename", "''");
-        finishJSTest();
-    }
-    xhr.send(formData);
-}
-
-runTest();
-
-var successfullyParsed = true;
-</script>
-<script src="../../../../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
-
diff --git a/LayoutTests/http/tests/local/formdata/send-form-data-with-empty-file-filename-expected.txt b/LayoutTests/http/tests/local/formdata/send-form-data-with-empty-file-filename-expected.txt
deleted file mode 100644 (file)
index 37ea9af..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-Test that filename passed to FormData.append() takes precedence over filename in File, even if empty.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Sending FormData containing one file with custom empty filename:
-PASS filename is ''
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/http/tests/local/formdata/send-form-data-with-empty-file-filename.html b/LayoutTests/http/tests/local/formdata/send-form-data-with-empty-file-filename.html
deleted file mode 100644 (file)
index 2ba9486..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../../../fast/js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src="resources/send-form-data-common.js"></script>
-<script>
-description("Test that filename passed to FormData.append() takes precedence over filename in File, even if empty.");
-
-self.jsTestIsAsync = true;
-
-function runTest()
-{
-    debug("Sending FormData containing one file with custom empty filename:");
-    
-    var input = document.getElementsByTagName("input")[0];
-    if (window.eventSender) {
-        eventSender.beginDragWithFiles(['../resources/file-for-drag-to-send.txt']);
-        moveMouseToCenterOfElement(input);
-        eventSender.mouseUp();
-    }
-
-    var formData = new FormData;
-    formData.append("file", input.files[0], "");
-    var xhr = new XMLHttpRequest();
-    xhr.open("POST", "http://127.0.0.1:8000/xmlhttprequest/resources/multipart-post-echo-filenames.php", true);
-    xhr.onload = function() {
-        filename = xhr.responseText;
-        shouldBe("filename", "''");
-        formDataTestingCleanup();
-        finishJSTest();
-    }
-
-    xhr.send(formData);
-}
-
-if (window.eventSender) {
-    runTest();
-} else {
-    debug("To run this test manually, please drag a file onto file input above");
-    document.getElementsByTagName("input")[0].onchange = runTest;
-}
-
-var successfullyParsed = true;
-</script>
-<script src="../../../../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
-
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/multipart-post-echo-filenames.php b/LayoutTests/http/tests/xmlhttprequest/resources/multipart-post-echo-filenames.php
deleted file mode 100644 (file)
index c79cce9..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php
-$first = True;
-foreach ($_FILES as $file) {
-    if (!$first)
-        echo ",";
-    echo $file['name'];
-    $first = False;
-}
-?>
index b5f6864..5ea176f 100644 (file)
@@ -868,7 +868,6 @@ http/tests/local/formdata/send-form-data-constructed-from-form.html
 http/tests/local/formdata/send-form-data-with-filename.html
 http/tests/local/formdata/send-form-data-with-sliced-file.html
 http/tests/local/formdata/send-form-data.html
-http/tests/local/formdata/send-form-data-with-empty-file-filename.html
 http/tests/local/formdata/upload-events.html
 http/tests/security/clipboard/clipboard-file-access.html
 media/video-src-blob.html
index b0f4e06..43dd741 100644 (file)
@@ -1,3 +1,17 @@
+2013-03-07  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r145097.
+        http://trac.webkit.org/changeset/145097
+        https://bugs.webkit.org/show_bug.cgi?id=111765
+
+        Triggers an ASSERT in the Chromium port (Requested by abarth
+        on #webkit).
+
+        * html/FileInputType.cpp:
+        (WebCore::FileInputType::appendFormData):
+        * platform/network/FormData.cpp:
+        (WebCore::FormData::appendKeyValuePairItems):
+
 2013-03-07  Chris Fleizach  <cfleizach@apple.com>
 
         AX: Can't activate links with VoiceOver in Safari
index 061ccec..8bcc101 100644 (file)
@@ -40,7 +40,6 @@
 #include "RenderFileUploadControl.h"
 #include "ScriptController.h"
 #include "ShadowRoot.h"
-#include "WebKitBlobBuilder.h"
 #include <wtf/PassOwnPtr.h>
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/WTFString.h>
@@ -155,7 +154,7 @@ bool FileInputType::appendFormData(FormDataList& encoding, bool multipart) const
     // If no filename at all is entered, return successful but empty.
     // Null would be more logical, but Netscape posts an empty file. Argh.
     if (!numFiles) {
-        encoding.appendBlob(element()->name(), BlobBuilder().getBlob(ASCIILiteral("application/octet-stream")), emptyString());
+        encoding.appendBlob(element()->name(), File::create(""));
         return true;
     }
 
index f6d4588..381d17b 100644 (file)
@@ -244,11 +244,11 @@ void FormData::appendKeyValuePairItems(const FormDataList& list, const TextEncod
                     }
 
                     // If a filename is passed in FormData.append(), use it instead of the file blob's name.
-                    if (!value.filename().isNull())
+                    if (!value.filename().isEmpty())
                         name = value.filename();
                 } else {
                     // For non-file blob, use the filename if it is passed in FormData.append().
-                    if (!value.filename().isNull())
+                    if (!value.filename().isEmpty())
                         name = value.filename();
                     else
                         name = "blob";