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

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 18:44:38 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit d6469ce57f55875da0f42fa0db666c4966548a48
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 17 02:28:48 2010 +0000

    2010-12-16  Yong Li  <yoli at rim.com>
    
            Reviewed by Alexey Proskuryakov.
    
            https://bugs.webkit.org/show_bug.cgi?id=51199
            Add decoding tests for UTF-16 LE/BE and their variants.
            Also, check the full decoded text but not only the first one.
    
            * fast/encoding/char-decoding.html:
            * fast/encoding/char-decoding-expected.txt:
            * fast/encoding/resources/char-decoding-utils.js:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74225 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 8a87318..94950c5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-16  Yong Li  <yoli at rim.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        https://bugs.webkit.org/show_bug.cgi?id=51199
+        Add decoding tests for UTF-16 LE/BE and their variants.
+        Also, check the full decoded text but not only the first one.
+
+        * fast/encoding/char-decoding.html:
+        * fast/encoding/char-decoding-expected.txt:
+        * fast/encoding/resources/char-decoding-utils.js:
+
 2010-12-16  Jian Li  <jianli at chromium.org>
 
         Unreviewed. Updated chromium test expectations to mark
diff --git a/LayoutTests/fast/encoding/char-decoding-expected.txt b/LayoutTests/fast/encoding/char-decoding-expected.txt
index 26afe48..4eaf6c0 100644
--- a/LayoutTests/fast/encoding/char-decoding-expected.txt
+++ b/LayoutTests/fast/encoding/char-decoding-expected.txt
@@ -155,8 +155,17 @@ PASS decode('dos-874', '%96') is 'U+2013'
 PASS decode('dos-874', '%A0') is 'U+00A0'
 PASS decode('dos-874', '%A1') is 'U+0E01'
 PASS decode('dos-874', '%DB') is 'U+F8C1'
-PASS decode('UTF-7', '+AD4') is 'U+002B'
-PASS decode('utf-7', '+AD4') is 'U+002B'
+PASS decode('UTF-7', '+AD4') is 'U+002B/U+0041/U+0044/U+0034'
+PASS decode('utf-7', '+AD4') is 'U+002B/U+0041/U+0044/U+0034'
+PASS decode('UTF-16LE', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('unicodeFEFF', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('UTF-16', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('ISO-10646-UCS-2', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('UCS-2', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('Unicode', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('csUnicode', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('UTF-16BE', '%D8%69%DE%D6') is 'U+D869/U+DED6'
+PASS decode('unicodeFFFE', '%D8%69%DE%D6') is 'U+D869/U+DED6'
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/encoding/char-decoding.html b/LayoutTests/fast/encoding/char-decoding.html
index b913389..d681170 100644
--- a/LayoutTests/fast/encoding/char-decoding.html
+++ b/LayoutTests/fast/encoding/char-decoding.html
@@ -89,9 +89,23 @@ batchTestDecode(thai);
 
 // UTF-7 is expressly forbidden, so decoding it should not work correctly.
 // This attempts to decode '<' as UTF-7 (+AD4) but it ends up being decoded
-// as a '+'.
-testDecode('UTF-7', '+AD4', 'U+002B');
-testDecode('utf-7', '+AD4', 'U+002B');
+// as a '+AD4'.
+testDecode('UTF-7', '+AD4', 'U+002B/U+0041/U+0044/U+0034');
+testDecode('utf-7', '+AD4', 'U+002B/U+0041/U+0044/U+0034');
+
+// UTF-16LE and variants.
+testDecode('UTF-16LE', '%69%D8%D6%DE', 'U+D869/U+DED6');
+testDecode('unicodeFEFF', '%69%D8%D6%DE', 'U+D869/U+DED6');
+// According to HTML5 and for IE compatibility, UTF-16 is treated as little endian. The following tests fail as of Firefox 3.6.13.
+testDecode('UTF-16', '%69%D8%D6%DE', 'U+D869/U+DED6');
+testDecode('ISO-10646-UCS-2', '%69%D8%D6%DE', 'U+D869/U+DED6');
+testDecode('UCS-2', '%69%D8%D6%DE', 'U+D869/U+DED6');
+testDecode('Unicode', '%69%D8%D6%DE', 'U+D869/U+DED6');
+testDecode('csUnicode', '%69%D8%D6%DE', 'U+D869/U+DED6');
+
+// UTF-16BE and variants.
+testDecode('UTF-16BE', '%D8%69%DE%D6', 'U+D869/U+DED6');
+testDecode('unicodeFFFE', '%D8%69%DE%D6', 'U+D869/U+DED6');
 
 successfullyParsed = true;
 
diff --git a/LayoutTests/fast/encoding/resources/char-decoding-utils.js b/LayoutTests/fast/encoding/resources/char-decoding-utils.js
index a091ad8..07d2e60 100644
--- a/LayoutTests/fast/encoding/resources/char-decoding-utils.js
+++ b/LayoutTests/fast/encoding/resources/char-decoding-utils.js
@@ -9,14 +9,26 @@ function hex(number)
     return hex;
 }
 
-function decode(charsetName, characterSequence)
+function decodeText(charsetName, characterSequence)
 {
     var req = new XMLHttpRequest;
     req.open('GET', 'data:text/plain,' + characterSequence, false);
     req.overrideMimeType('text/plain; charset="' + charsetName + '"');
     req.send('');
-    var code = hex(req.responseText.charCodeAt(0));
-    return "U+" + ("0000" + code).substr(code.length, 4);
+    return req.responseText;
+}
+
+function decode(charsetName, characterSequence)
+{
+    var decodedText = decodeText(charsetName, characterSequence);
+    var result = "";
+    for (var i = 0; i < decodedText.length; ++i) {
+        var code = hex(decodedText.charCodeAt(i));
+        if (i)
+            result += "/";
+        result += "U+" + ("0000" + code).substr(code.length, 4);
+    }
+    return result;
 }
 
 function testDecode(charsetName, characterSequence, unicode)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list