Skip to content

Commit

Permalink
Add a test for non-ASCII strings in CharacterData#substringData.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Jun 8, 2015
1 parent 00b473d commit 579f70b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dom/nodes/CharacterData-substringData.html
Expand Up @@ -7,7 +7,6 @@
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
// TODO: non-ASCII strings
function testNode(create, type) {
test(function() {
var node = create()
Expand Down Expand Up @@ -101,6 +100,16 @@
assert_equals(node.substringData(0, -1), "test")
assert_equals(node.substringData(0, -0x100000000 + 2), "te")
}, type + ".substringData() with negative count")

test(function() {
var node = create()
assert_equals(node.data, "test")

node.data = "This is the character data test, other 資料,更多文字"

assert_equals(node.substringData(12, 4), "char")
assert_equals(node.substringData(39, 2), "資料")
}, type + ".substringData() with non-ASCII data")
}

testNode(function() { return document.createTextNode("test") }, "Text")
Expand Down

0 comments on commit 579f70b

Please sign in to comment.