https://github.com/web-platform-tests/wpt
Raw File
Tip revision: eb67b371f0b9ea482a1f8c8b22f20468a42f23b0 authored by James Graham on 27 March 2014, 15:31:25 UTC
Change terminate test not to spam the event loop with so many messages
Tip revision: eb67b37
CharacterData-insertData.html
<!DOCTYPE html>
<meta charset=utf-8>
<title>CharacterData.insertData</title>
<link rel=help href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-insertdata">
<link rel=help href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
function testNode(node) {
  test(function() {
    assert_throws("INDEX_SIZE_ERR", function() { node.insertData(5, "x") })
    assert_throws("INDEX_SIZE_ERR", function() { node.insertData(5, "") })
    node.insertData(2, "X")
    assert_equals(node.data, "teXst")
  })
  test(function() {
    node.data = "test"
    assert_equals(node.data, "test")
    node.insertData(4, "ing")
    assert_equals(node.data, "testing")
  })
}
test(function() {
  testNode(document.createTextNode("test"))
  testNode(document.createComment("test"))
})
</script>
back to top