diff options
Diffstat (limited to 'LayoutTests/fast/dom/Text/script-tests')
-rw-r--r-- | LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html | 13 | ||||
-rw-r--r-- | LayoutTests/fast/dom/Text/script-tests/replaceWholeText.js | 16 |
2 files changed, 29 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html new file mode 100644 index 0000000..1951c43 --- /dev/null +++ b/LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<link rel="stylesheet" href="../../js/resources/js-test-style.css"> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="YOUR_JS_FILE_HERE"></script> +<script src="../../js/resources/js-test-post.js"></script> +</body> +</html> diff --git a/LayoutTests/fast/dom/Text/script-tests/replaceWholeText.js b/LayoutTests/fast/dom/Text/script-tests/replaceWholeText.js new file mode 100644 index 0000000..33b6dc8 --- /dev/null +++ b/LayoutTests/fast/dom/Text/script-tests/replaceWholeText.js @@ -0,0 +1,16 @@ +description("Test wholeText and replaceWholeText") + +var para = document.createElement('p'); +para.appendChild(document.createTextNode('A')); +var textB = document.createTextNode('B'); +para.appendChild(textB); +para.appendChild(document.createElement('p')); +para.appendChild(document.createTextNode('C')); + +shouldBe("textB.wholeText", "'AB'"); +shouldBe("para.textContent", "'ABC'"); +textB.replaceWholeText("XYZ"); +shouldBe("textB.wholeText", "'XYZ'"); +shouldBe("para.textContent", "'XYZC'"); + +var successfullyParsed = true; |