[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

xji at chromium.org xji at chromium.org
Sun Feb 20 23:45:11 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit a56fc183dc87ca0a3785221d29ee41d3f83e4076
Author: xji at chromium.org <xji at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 24 22:25:07 2011 +0000

    2011-01-24  Xiaomei Ji  <xji at chromium.org>
    
            Reviewed by Ryosuke Niwa.
    
            Add test for Chinese Segmentation.
            https://bugs.webkit.org/show_bug.cgi?id=52926
    
            The CJK segmentation currently does not work in other ports except Chromium.
            Please refer to https://bugs.webkit.org/show_bug.cgi?id=53044 for detail.
    
            * fast/text/international/cjk-segmentation-expected.txt: Added.
            * fast/text/international/cjk-segmentation.html: Added.
            * platform/chromium/fast/text/international: Added.
            * platform/chromium/fast/text/international/cjk-segmentation-expected.txt: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76548 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 40aee7d..643ae44 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2011-01-24  Xiaomei Ji  <xji at chromium.org>
+
+        Reviewed by Ryosuke Niwa.
+
+        Add test for Chinese Segmentation.
+        https://bugs.webkit.org/show_bug.cgi?id=52926
+
+        The CJK segmentation currently does not work in other ports except Chromium.
+        Please refer to https://bugs.webkit.org/show_bug.cgi?id=53044 for detail.
+
+        * fast/text/international/cjk-segmentation-expected.txt: Added.
+        * fast/text/international/cjk-segmentation.html: Added.
+        * platform/chromium/fast/text/international: Added.
+        * platform/chromium/fast/text/international/cjk-segmentation-expected.txt: Added.
+
 2011-01-24  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/text/international/cjk-segmentation-expected.txt b/LayoutTests/fast/text/international/cjk-segmentation-expected.txt
new file mode 100644
index 0000000..941104d
--- /dev/null
+++ b/LayoutTests/fast/text/international/cjk-segmentation-expected.txt
@@ -0,0 +1,182 @@
+Test Chinese Segmentation.
+
+==================================
+FAILED test
+actual: 国
+expected: 国务院
+==================================
+FAILED test
+actual: 院
+expected: 国务院
+==================================
+FAILED test
+actual: 关
+expected: 关于
+==================================
+FAILED test
+actual: 于
+expected: 关于
+==================================
+FAILED test
+actual: 土
+expected: 土地
+==================================
+FAILED test
+actual: 地
+expected: 土地
+==================================
+FAILED test
+actual: 房
+expected: 房屋
+==================================
+FAILED test
+actual: 屋
+expected: 房屋
+==================================
+FAILED test
+actual: 管
+expected: 管理
+==================================
+FAILED test
+actual: 理
+expected: 管理
+==================================
+FAILED test
+actual: 条
+expected: 条例
+==================================
+FAILED test
+actual: 例
+expected: 条例
+==================================
+FAILED test
+actual: 物
+expected: 物价
+==================================
+FAILED test
+actual: 价
+expected: 物价
+==================================
+FAILED test
+actual: 预
+expected: 预期
+==================================
+FAILED test
+actual: 期
+expected: 预期
+==================================
+FAILED test
+actual: 调
+expected: 调控
+==================================
+FAILED test
+actual: 控
+expected: 调控
+==================================
+FAILED test
+actual: 目
+expected: 目标
+==================================
+FAILED test
+actual: 标
+expected: 目标
+==================================
+FAILED test
+actual: 基
+expected: 基本
+==================================
+FAILED test
+actual: 本
+expected: 基本
+==================================
+FAILED test
+actual: 实
+expected: 实现
+==================================
+FAILED test
+actual: 现
+expected: 实现
+==================================
+FAILED test
+actual: 俄
+expected: 俄罗斯
+==================================
+FAILED test
+actual: 罗
+expected: 罗斯
+==================================
+FAILED test
+actual: 斯
+expected: 俄罗斯
+==================================
+FAILED test
+actual: 总
+expected: 总统
+==================================
+FAILED test
+actual: 统
+expected: 总统
+==================================
+FAILED test
+actual: 机
+expected: 机场
+==================================
+FAILED test
+actual: 场
+expected: 机场
+==================================
+FAILED test
+actual: 爆
+expected: 爆炸
+==================================
+FAILED test
+actual: 炸
+expected: 爆炸
+==================================
+FAILED test
+actual: 恐
+expected: 恐怖
+==================================
+FAILED test
+actual: 怖
+expected: 恐怖
+==================================
+FAILED test
+actual: 袭
+expected: 袭击
+==================================
+FAILED test
+actual: 击
+expected: 袭击
+==================================
+FAILED test
+actual: 春
+expected: 春运
+==================================
+FAILED test
+actual: 运
+expected: 春运
+==================================
+FAILED test
+actual: 北
+expected: 北京
+==================================
+FAILED test
+actual: 京
+expected: 北京
+==================================
+FAILED test
+actual: 运
+expected: 运送
+==================================
+FAILED test
+actual: 送
+expected: 运送
+==================================
+FAILED test
+actual: 旅
+expected: 旅客
+==================================
+FAILED test
+actual: 客
+expected: 旅客
diff --git a/LayoutTests/fast/text/international/cjk-segmentation.html b/LayoutTests/fast/text/international/cjk-segmentation.html
new file mode 100644
index 0000000..8b74566
--- /dev/null
+++ b/LayoutTests/fast/text/international/cjk-segmentation.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Test for CJK segmentation</title>
+<script>
+function log(str)
+{
+    var li = document.createElement("li");
+    li.appendChild(document.createTextNode(str));
+    var console = document.getElementById("console");
+    console.appendChild(li);
+}
+
+function assertEqual(test_name, actual, expected)
+{
+    if (actual != expected) {
+        log("==================================");
+        log("FAILED test " + test_name);
+        log("actual: " + actual);
+        log("expected: " + expected);
+    }
+}
+
+function test()
+{
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var range = document.createRange();
+    var divs = document.getElementsByClassName("zh-CN-div");
+    var pass = true;
+    for (var j = 0; j < divs.length; ++j) {
+        var div = divs[j];
+        var length = div.innerText.length;
+        var title = div.title.split(' ');
+        for (var i = 0; i < length; ++i) {
+            range.setStart(div.firstChild, i);
+            range.setEnd(div.firstChild, i);
+            range.expand('word');
+            var actual = range.toString();
+            assertEqual(" ", actual, title[i]);
+            if (actual != title[i])
+                pass = false;
+        }
+        div.style.display = "none";
+    }
+    if (pass == true)
+        log("ALL PASS");
+}
+</script>
+<body onload="test()">
+<p>Test Chinese Segmentation.
+<div class="zh-CN-div" title="国务院 务 国务院 关于 关于 《 土地 土地 房屋 房屋 管理 管理 条例 条例 》">国务院关于《土地房屋管理条例》</div>
+<div class="zh-CN-div" title="物价 物价 预期 预期 调控 调控 目标 目标 基本 基本 实现 实现">物价预期调控目标基本实现</div>
+<div class="zh-CN-div" title="俄罗斯 罗斯 俄罗斯 总统 总统 : 机场 机场 爆炸 爆炸 是 恐怖 恐怖 袭击 袭击">俄罗斯总统:机场爆炸是恐怖袭击</div>
+<div class="zh-CN-div" title="春运 春运 5 天 , 北京 北京 运送 运送 旅客 旅客 146 146 146 万">春运5天,北京运送旅客146万</div>
+<ul id="console"></ul>
+
+</body>
+</html>
diff --git a/LayoutTests/platform/chromium/fast/text/international/cjk-segmentation-expected.txt b/LayoutTests/platform/chromium/fast/text/international/cjk-segmentation-expected.txt
new file mode 100644
index 0000000..bd43819
--- /dev/null
+++ b/LayoutTests/platform/chromium/fast/text/international/cjk-segmentation-expected.txt
@@ -0,0 +1,3 @@
+Test Chinese Segmentation.
+
+ALL PASS

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list