File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
src/test/java/org/htmlunit/html Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -140,4 +140,28 @@ public void getRootNode() throws Exception {
140
140
141
141
loadPageVerifyTitle2 (content );
142
142
}
143
+
144
+ /**
145
+ * @throws Exception on test failure
146
+ */
147
+ @ Test
148
+ @ Alerts ("beforeafter" )
149
+ public void textContentCdata () throws Exception {
150
+ final String content = "<html>\n "
151
+ + "<head>\n "
152
+ + " <script>\n "
153
+ + LOG_TITLE_FUNCTION
154
+ + " function test() {\n "
155
+ + " log(document.getElementById('tester').textContent);\n "
156
+ + " }\n "
157
+ + " </script>\n "
158
+ + "</head>\n "
159
+ + "<body onload='test()'>\n "
160
+ + "<div id='tester'>before<![CDATA[inside]]>after</div>\n "
161
+ + "</body>\n "
162
+ + "</html>" ;
163
+
164
+ loadPageVerifyTitle2 (content );
165
+ }
166
+
143
167
}
Original file line number Diff line number Diff line change @@ -1764,6 +1764,18 @@ public void getVisibleTextDetailsOpen() throws Exception {
1764
1764
+ "</details>" );
1765
1765
}
1766
1766
1767
+
1768
+ /**
1769
+ * @throws Exception if the test fails
1770
+ */
1771
+ @ Test
1772
+ @ Alerts ("beforeafter" )
1773
+ public void getVisibleTextCdata () throws Exception {
1774
+ getVisibleTextFormated ("<div id='tester'>"
1775
+ + "before<![CDATA[inside]]>after"
1776
+ + "</div>" );
1777
+ }
1778
+
1767
1779
private void getVisibleTextFormated (final String htmlTesterSnipped ) throws Exception {
1768
1780
final String htmlContent
1769
1781
= "<html>\n "
You can’t perform that action at this time.
0 commit comments