[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

jianli at chromium.org jianli at chromium.org
Wed Dec 22 14:41:06 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit a57f66b10de4bfaec5b266348178870075e2804e
Author: jianli at chromium.org <jianli at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 15 21:46:43 2010 +0000

    FileReader.readAsDataURL should take Blob object
    https://bugs.webkit.org/show_bug.cgi?id=47679
    
    Reviewed by Dmitry Titov.
    
    WebCore:
    
    Test cases have been added into read-blob-test-cases.js.
    
    * fileapi/FileReader.idl: Update per the latest File API spec.
    
    LayoutTests:
    
    * fast/files/read-blob-async-expected.txt:
    * fast/files/resources/read-blob-test-cases.js:
    (testReadingSingleTextBlobAsDataURL):
    (testReadingSingleTextBlobAsDataURL2):
    (testReadingTripleSlicedHybridBlob):
    * fast/files/resources/read-common.js:
    (buildBlob):
    * fast/files/workers/worker-read-blob-async-expected.txt:
    * fast/files/workers/worker-read-blob-sync-expected.txt:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69883 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 15b954b..f91a5cf 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2010-10-15  Jian Li  <jianli at chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        FileReader.readAsDataURL should take Blob object
+        https://bugs.webkit.org/show_bug.cgi?id=47679
+
+        * fast/files/read-blob-async-expected.txt:
+        * fast/files/resources/read-blob-test-cases.js:
+        (testReadingSingleTextBlobAsDataURL):
+        (testReadingSingleTextBlobAsDataURL2):
+        (testReadingTripleSlicedHybridBlob):
+        * fast/files/resources/read-common.js:
+        (buildBlob):
+        * fast/files/workers/worker-read-blob-async-expected.txt:
+        * fast/files/workers/worker-read-blob-sync-expected.txt:
+
 2010-10-15  Ryosuke Niwa  <rniwa at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/files/read-blob-async-expected.txt b/LayoutTests/fast/files/read-blob-async-expected.txt
index 0c10d5d..27d8c0a 100644
--- a/LayoutTests/fast/files/read-blob-async-expected.txt
+++ b/LayoutTests/fast/files/read-blob-async-expected.txt
@@ -56,6 +56,24 @@ readyState: 2
 result size: 5
 result: First
 Received loadend event
+Test reading a blob containing single text as data URL
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 20
+result: data:base64,Rmlyc3Q=
+Received loadend event
+Test reading a blob containing single text as data URL (optional content type provided)
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 29
+result: data:type/foo;base64,Rmlyc3Q=
+Received loadend event
 Test reading a blob containing sliced file
 readyState: 0
 Received loadstart event
diff --git a/LayoutTests/fast/files/resources/read-blob-test-cases.js b/LayoutTests/fast/files/resources/read-blob-test-cases.js
index 7550c27..a579eaa 100644
--- a/LayoutTests/fast/files/resources/read-blob-test-cases.js
+++ b/LayoutTests/fast/files/resources/read-blob-test-cases.js
@@ -6,6 +6,8 @@ var testCases = [
     "testReadingEmptyFileAndTextBlob",
     "testReadingSingleFileBlob",
     "testReadingSingleTextBlob",
+    "testReadingSingleTextBlobAsDataURL",
+    "testReadingSingleTextBlobAsDataURL2",
     "testReadingSlicedFileBlob",
     "testReadingSlicedTextBlob",
     "testReadingMultipleFileBlob",
@@ -75,6 +77,20 @@ function testReadingSingleTextBlob(testFiles)
     readBlobAsBinaryString(testFiles, blob);
 }
 
+function testReadingSingleTextBlobAsDataURL(testFiles)
+{
+    log("Test reading a blob containing single text as data URL");
+    var blob = buildBlob(['First']);
+    readBlobAsDataURL(testFiles, blob);
+}
+
+function testReadingSingleTextBlobAsDataURL2(testFiles)
+{
+    log("Test reading a blob containing single text as data URL (optional content type provided)");
+    var blob = buildBlob(['First'], 'type/foo');
+    readBlobAsDataURL(testFiles, blob);
+}
+
 function testReadingSlicedFileBlob(testFiles)
 {
     log("Test reading a blob containing sliced file");
@@ -123,9 +139,9 @@ function testReadingTripleSlicedHybridBlob(testFiles)
 {
     log("Test reading a triple-sliced hybrid blob");
     var builder = new BlobBuilder();
-    var blob = buildBlob(['First', testFiles['file1'].slice(1, 10), testFiles['empty-file'], 'Second', testFiles['file2'], testFiles['file3'], 'Third'], builder);
+    var blob = buildBlob(['First', testFiles['file1'].slice(1, 10), testFiles['empty-file'], 'Second', testFiles['file2'], testFiles['file3'], 'Third'], undefined, builder);
     var blob = blob.slice(7, 12);
-    var blob2 = buildBlob(['Foo', blob, 'Bar'], builder);
+    var blob2 = buildBlob(['Foo', blob, 'Bar'], undefined, builder);
     var blob2 = blob2.slice(12, 30);
     readBlobAsBinaryString(testFiles, blob2);
 }
diff --git a/LayoutTests/fast/files/resources/read-common.js b/LayoutTests/fast/files/resources/read-common.js
index 03bcb6f..abe324f 100644
--- a/LayoutTests/fast/files/resources/read-common.js
+++ b/LayoutTests/fast/files/resources/read-common.js
@@ -1,12 +1,13 @@
 // Builds a blob from a list of items.
+// The 'contentType' argument is optional.
 // If the 'builder' argument is not provided, create a new one.
-function buildBlob(items, builder)
+function buildBlob(items, contentType, builder)
 {
     if (builder === undefined)
         builder = new BlobBuilder();
     for (var i = 0; i < items.length; i++)
         builder.append(items[i]);
-    return builder.getBlob();
+    return builder.getBlob(contentType);
 }
 
 // Reads a blob either asynchronously or synchronously.
diff --git a/LayoutTests/fast/files/workers/worker-read-blob-async-expected.txt b/LayoutTests/fast/files/workers/worker-read-blob-async-expected.txt
index 6cfed90..89bbd88 100644
--- a/LayoutTests/fast/files/workers/worker-read-blob-async-expected.txt
+++ b/LayoutTests/fast/files/workers/worker-read-blob-async-expected.txt
@@ -57,6 +57,24 @@ readyState: 2
 result size: 5
 result: First
 Received loadend event
+Test reading a blob containing single text as data URL
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 20
+result: data:base64,Rmlyc3Q=
+Received loadend event
+Test reading a blob containing single text as data URL (optional content type provided)
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 29
+result: data:type/foo;base64,Rmlyc3Q=
+Received loadend event
 Test reading a blob containing sliced file
 readyState: 0
 Received loadstart event
diff --git a/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt b/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt
index 77f5414..3d9058b 100644
--- a/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt
+++ b/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt
@@ -14,6 +14,10 @@ Test reading a blob containing single file
 Hello
 Test reading a blob containing single text
 First
+Test reading a blob containing single text as data URL
+data:base64,Rmlyc3Q=
+Test reading a blob containing single text as data URL (optional content type provided)
+result: data:type/foo;base64,Rmlyc3Q=
 Test reading a blob containing sliced file
 onder
 Test reading a blob containing sliced text
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 55e8059..3d86c5f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,14 @@
+2010-10-15  Jian Li  <jianli at chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        FileReader.readAsDataURL should take Blob object
+        https://bugs.webkit.org/show_bug.cgi?id=47679
+
+        Test cases have been added into read-blob-test-cases.js.
+
+        * fileapi/FileReader.idl: Update per the latest File API spec.
+
 2010-10-15  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/fileapi/FileReader.idl b/WebCore/fileapi/FileReader.idl
index 723d242..febb231 100644
--- a/WebCore/fileapi/FileReader.idl
+++ b/WebCore/fileapi/FileReader.idl
@@ -44,9 +44,9 @@ module html {
         readonly attribute unsigned short readyState;
 
         // async read methods
-        void readAsBinaryString(in Blob fileBlob);
-        void readAsText(in Blob fileBlob, in [Optional] DOMString encoding);
-        void readAsDataURL(in File file);
+        void readAsBinaryString(in Blob blob);
+        void readAsText(in Blob blob, in [Optional] DOMString encoding);
+        void readAsDataURL(in Blob blob);
 
         void abort();
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list