mirror of
https://github.com/servo/servo.git
synced 2025-08-27 08:08:19 +01:00
Update web-platform-tests.
This commit is contained in:
parent
74afd086d2
commit
71008d816d
62 changed files with 793 additions and 150 deletions
|
@ -7,15 +7,56 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function testNode(node) {
|
||||
function testNode(create, type) {
|
||||
test(function() {
|
||||
var node = create()
|
||||
assert_equals(node.data, "test")
|
||||
node.appendData("test")
|
||||
assert_equals(node.data, "testtest")
|
||||
})
|
||||
|
||||
node.appendData("bar")
|
||||
assert_equals(node.data, "testbar")
|
||||
}, type + ".appendData('bar')")
|
||||
|
||||
test(function() {
|
||||
var node = create()
|
||||
assert_equals(node.data, "test")
|
||||
|
||||
node.appendData("")
|
||||
assert_equals(node.data, "test")
|
||||
}, type + ".appendData('')")
|
||||
|
||||
test(function() {
|
||||
var node = create()
|
||||
assert_equals(node.data, "test")
|
||||
|
||||
node.appendData(null)
|
||||
assert_equals(node.data, "testnull")
|
||||
}, type + ".appendData(null)")
|
||||
|
||||
test(function() {
|
||||
var node = create()
|
||||
assert_equals(node.data, "test")
|
||||
|
||||
node.appendData(undefined)
|
||||
assert_equals(node.data, "testundefined")
|
||||
}, type + ".appendData(undefined)")
|
||||
|
||||
test(function() {
|
||||
var node = create()
|
||||
assert_equals(node.data, "test")
|
||||
|
||||
node.appendData("", "bar")
|
||||
assert_equals(node.data, "test")
|
||||
}, type + ".appendData('', 'bar')")
|
||||
|
||||
test(function() {
|
||||
var node = create()
|
||||
assert_equals(node.data, "test")
|
||||
|
||||
assert_throws(new TypeError(), function() { node.appendData() });
|
||||
assert_equals(node.data, "test")
|
||||
}, type + ".appendData()")
|
||||
}
|
||||
test(function() {
|
||||
testNode(document.createTextNode("test"))
|
||||
testNode(document.createComment("test"))
|
||||
})
|
||||
|
||||
testNode(function() { return document.createTextNode("test") }, "Text")
|
||||
testNode(function() { return document.createComment("test") }, "Comment")
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue