Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Node/normalize-with-cdata.html

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/dom/Node/normalize-with-cdata.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/normalize-with-cdata.html b/third_party/WebKit/LayoutTests/fast/dom/Node/normalize-with-cdata.html
index 0b1cafb35b17c4065458aaf2ce5c4c9bd80b5254..d326aed6d893d10c4e00d5f351c72f3521bc0508 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Node/normalize-with-cdata.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/Node/normalize-with-cdata.html
@@ -4,6 +4,27 @@
<script src="../../../resources/js-test.js"></script>
</head>
<body>
-<script src="script-tests/normalize-with-cdata.js"></script>
+<script>
+description('Test of normalize on an XML document with CDATA.');
+
+var parser = new DOMParser();
+var serializer = new XMLSerializer();
+
+var xmlChunk = parser.parseFromString(
+ '<foo>' +
+ 'This is some text before the CDATA' +
+ '<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>' +
+ 'This is some text after the CDATA' +
+ '</foo>',
+ 'application/xml');
+
+debug('Before normalize');
+shouldBe('serializer.serializeToString(xmlChunk)', '"<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"');
+shouldBe('xmlChunk.documentElement.childNodes.length', '3');
+xmlChunk.documentElement.normalize();
+debug('After normalize');
+shouldBe('serializer.serializeToString(xmlChunk)', '"<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"');
+shouldBe('xmlChunk.documentElement.childNodes.length', '3');
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698