Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/text/international/cjk-segmentation.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/text/international/cjk-segmentation.html b/third_party/WebKit/LayoutTests/fast/text/international/cjk-segmentation.html |
| index 6110cbcf5a36c7d55e012c8e6b3c48a517be299d..2540e4673b0b3125ce22559253cb7a4f1db88ee3 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/text/international/cjk-segmentation.html |
| +++ b/third_party/WebKit/LayoutTests/fast/text/international/cjk-segmentation.html |
| @@ -27,7 +27,7 @@ function test() |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| - var range = document.createRange(); |
| + var selection = getSelection(); |
| var divs = document.getElementsByClassName("zh-CN-div"); |
| var pass = true; |
| for (var j = 0; j < divs.length; ++j) { |
| @@ -35,10 +35,9 @@ function test() |
| 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(); |
| + selection.collapse(div.firstChild, i); |
| + selection.modify("extend", "forward", "word"); |
| + var actual = selection.getRangeAt(0).toString(); |
|
ramya.v
2016/05/18 04:42:16
Did I add anything incorrect here?
|
| assertEqual(" ", actual, title[i]); |
| if (actual != title[i]) |
| pass = false; |