Skip to content

Commit a110b4b

Browse files
committed
on the way to use html5 doctype for all our tests
1 parent e6e474b commit a110b4b

22 files changed

+296
-283
lines changed

src/test/java/org/htmlunit/javascript/JavaScriptEngine2Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ public void eventHandlerWithComment() throws Exception {
704704
public void comment() throws Exception {
705705
final String html = DOCTYPE_HTML
706706
+ "<html><head>\n"
707-
+ " <script>\n"
707+
+ " <script>\n"
708708
+ LOG_TITLE_FUNCTION
709709
+ " </script>\n"
710710
+ "<script><!-- log(1);\n"

src/test/java/org/htmlunit/javascript/host/dom/DocumentTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3086,7 +3086,7 @@ public void noBodyTag_IFrame() throws Exception {
30863086
public void fireEvent() throws Exception {
30873087
final String html = DOCTYPE_HTML
30883088
+ "<html><body>\n"
3089-
+ " <span id='s' onclick='\n"
3089+
+ " <span id='s' onclick='\n"
30903090
+ " if(document.fireEvent) {\n"
30913091
+ " document.onkeydown = function() {log(\"x\")};\n"
30923092
+ " document.fireEvent(\"onkeydown\");\n"

src/test/java/org/htmlunit/javascript/host/html/EnumeratorTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public class EnumeratorTest extends WebDriverTestCase {
3636
@Test
3737
@Alerts("Enumerator not supported")
3838
public void basicEmptyEnumerator() throws Exception {
39-
final String html
40-
= "<html><head><script>\n"
39+
final String html = DOCTYPE_HTML
40+
+ "<html><head><script>\n"
4141
+ LOG_TITLE_FUNCTION
4242
+ "function test() {\n"
4343
+ " if (typeof(Enumerator) != 'undefined') {\n"
@@ -67,8 +67,8 @@ public void basicEmptyEnumerator() throws Exception {
6767
@Test
6868
@Alerts("Enumerator not supported")
6969
public void basicEnumerator() throws Exception {
70-
final String html
71-
= "<html><head><script>\n"
70+
final String html = DOCTYPE_HTML
71+
+ "<html><head><script>\n"
7272
+ LOG_TITLE_FUNCTION
7373
+ "function test() {\n"
7474
+ " if (typeof(Enumerator) != 'undefined') {\n"
@@ -98,8 +98,8 @@ public void basicEnumerator() throws Exception {
9898
@Test
9999
@Alerts("Enumerator not supported")
100100
public void basicEnumeratorWrongType() throws Exception {
101-
final String html
102-
= "<html><head><script>\n"
101+
final String html = DOCTYPE_HTML
102+
+ "<html><head><script>\n"
103103
+ LOG_TITLE_FUNCTION
104104
+ "function test() {\n"
105105
+ " if (typeof(Enumerator) != 'undefined') {\n"
@@ -126,8 +126,8 @@ public void basicEnumeratorWrongType() throws Exception {
126126
@Test
127127
@Alerts({"f t1 t2", "Enumerator not supported"})
128128
public void formEnumerator() throws Exception {
129-
final String html
130-
= "<html>\n"
129+
final String html = DOCTYPE_HTML
130+
+ "<html>\n"
131131
+ "<body>\n"
132132
+ " <form id='f'>\n"
133133
+ " <input type='text' name='t1' id='t1' />\n"
@@ -160,8 +160,8 @@ public void formEnumerator() throws Exception {
160160
@Test
161161
@Alerts({"undefined", "Enumerator not supported"})
162162
public void item() throws Exception {
163-
final String html
164-
= "<html><head>\n"
163+
final String html = DOCTYPE_HTML
164+
+ "<html><head>\n"
165165
+ "<script>\n"
166166
+ LOG_TITLE_FUNCTION
167167
+ "function test() {\n"

src/test/java/org/htmlunit/javascript/host/html/FormChildTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public class FormChildTest extends WebDriverTestCase {
3434
@Test
3535
@Alerts({"f1", "f2"})
3636
public void formSimple() throws Exception {
37-
final String html
38-
= "<html>\n"
37+
final String html = DOCTYPE_HTML
38+
+ "<html>\n"
3939
+ "<head>\n"
4040
+ "<script>\n"
4141
+ LOG_TITLE_FUNCTION
@@ -65,8 +65,8 @@ public void formSimple() throws Exception {
6565
@Test
6666
@Alerts({"null", "null"})
6767
public void formBeforeAfter() throws Exception {
68-
final String html
69-
= "<html>\n"
68+
final String html = DOCTYPE_HTML
69+
+ "<html>\n"
7070
+ "<head>\n"
7171
+ "<script>\n"
7272
+ LOG_TITLE_FUNCTION

src/test/java/org/htmlunit/javascript/host/html/HTMLAllCollectionTest.java

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ public void namedItem_IndexDoubleAsString() throws Exception {
147147
}
148148

149149
private void namedItem(final String name) throws Exception {
150-
final String html
151-
= "<!doctype html>\n"
150+
final String html = DOCTYPE_HTML
152151
+ "<html id='myHtml'><head id='myHead'><title id='myTitle'>First</title><script>\n"
153152
+ " alerts = ''\n"
154153
+ " function log(msg) { alerts += msg + '§';}\n"
@@ -281,8 +280,7 @@ public void item_IndexDoubleAsString() throws Exception {
281280
}
282281

283282
private void item(final String name) throws Exception {
284-
final String html
285-
= "<!doctype html>\n"
283+
final String html = DOCTYPE_HTML
286284
+ "<html id='myHtml'><head id='myHead'><title id='myTitle'>First</title><script>\n"
287285
+ " alerts = ''\n"
288286
+ " function log(msg) { alerts += msg + '§';}\n"
@@ -399,8 +397,7 @@ public void arrayIndex_IndexAsString() throws Exception {
399397
}
400398

401399
private void arrayIndex(final String name) throws Exception {
402-
final String html
403-
= "<!doctype html>\n"
400+
final String html = DOCTYPE_HTML
404401
+ "<html id='myHtml'><head id='myHead'><title id='myTitle'>First</title><script>\n"
405402
+ " alerts = ''\n"
406403
+ " function log(msg) { alerts += msg + '§';}\n"
@@ -517,8 +514,7 @@ public void functionIndex_IndexAsString() throws Exception {
517514
}
518515

519516
private void functionIndex(final String name) throws Exception {
520-
final String html
521-
= "<!doctype html>\n"
517+
final String html = DOCTYPE_HTML
522518
+ "<html id='myHtml'><head id='myHead'><title id='myTitle'>First</title><script>\n"
523519
+ " alerts = ''\n"
524520
+ " function log(msg) { alerts += msg + '§';}\n"
@@ -559,7 +555,7 @@ private void functionIndex(final String name) throws Exception {
559555
@Test
560556
@Alerts({"[object HTMLAllCollection]", "function HTMLAllCollection() { [native code] }"})
561557
public void type() throws Exception {
562-
final String html = ""
558+
final String html = DOCTYPE_HTML
563559
+ "<html><head>\n"
564560
+ "<script>\n"
565561
+ LOG_TITLE_FUNCTION
@@ -583,7 +579,7 @@ public void type() throws Exception {
583579
@Test
584580
@Alerts("function () { [native code] }")
585581
public void proto() throws Exception {
586-
final String html = ""
582+
final String html = DOCTYPE_HTML
587583
+ "<html><head>\n"
588584
+ "<script>\n"
589585
+ LOG_TITLE_FUNCTION
@@ -606,7 +602,7 @@ public void proto() throws Exception {
606602
@Test
607603
@Alerts({"false", "true", "false", "true"})
608604
public void looselyEqualToUndefined() throws Exception {
609-
final String html = ""
605+
final String html = DOCTYPE_HTML
610606
+ "<html>\n"
611607
+ "<body>\n"
612608
+ "<script>\n"
@@ -629,7 +625,7 @@ public void looselyEqualToUndefined() throws Exception {
629625
@Test
630626
@Alerts({"false", "true", "false", "true"})
631627
public void looselyEqualToNull() throws Exception {
632-
final String html = ""
628+
final String html = DOCTYPE_HTML
633629
+ "<html>\n"
634630
+ "<body>\n"
635631
+ "<script>\n"
@@ -652,7 +648,7 @@ public void looselyEqualToNull() throws Exception {
652648
@Test
653649
@Alerts({"7", "1", "3", "[object HTMLAllCollection]", "5"})
654650
public void falsyInBooleanContexts() throws Exception {
655-
final String html = ""
651+
final String html = DOCTYPE_HTML
656652
+ "<html>\n"
657653
+ "<body>\n"
658654
+ "<script>\n"
@@ -682,7 +678,7 @@ public void falsyInBooleanContexts() throws Exception {
682678
@Test
683679
@Alerts("undefined")
684680
public void typeof() throws Exception {
685-
final String html = ""
681+
final String html = DOCTYPE_HTML
686682
+ "<html>\n"
687683
+ "<body>\n"
688684
+ "<script>\n"

0 commit comments

Comments
 (0)