1 /* |
1 /* |
2 * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
51 "-use", |
51 "-use", |
52 "-overview", testSrc("overview.html"), |
52 "-overview", testSrc("overview.html"), |
53 "-sourcepath", testSrc, |
53 "-sourcepath", testSrc, |
54 "p1", "p2"); |
54 "p1", "p2"); |
55 checkExit(Exit.OK); |
55 checkExit(Exit.OK); |
56 |
|
57 // Test the proper DOCTYPE element are present: |
|
58 checkOutput("index.html", true, LOOSE); |
|
59 checkOutput("overview-summary.html", true, LOOSE); |
|
60 checkOutput("p1/package-summary.html", true, LOOSE); |
|
61 checkOutput("p1/C.html", true, LOOSE); |
|
62 checkOutput("overview-frame.html", true, LOOSE); |
|
63 checkOutput("allclasses-frame.html", true, LOOSE); |
|
64 checkOutput("p1/package-frame.html", true, LOOSE); |
|
65 |
|
66 // Test for IFRAME element: |
56 // Test for IFRAME element: |
67 checkOutput("index.html", true, |
57 checkOutput("index.html", true, |
68 "<iframe"); |
58 "<iframe"); |
69 |
|
70 // Test the table elements are in the correct order: |
59 // Test the table elements are in the correct order: |
71 checkOutput("p1/package-use.html", true, |
60 checkOutput("p1/package-use.html", true, |
72 "</td>\n" |
61 "</td>\n" |
73 + "</tr>"); |
62 + "</tr>"); |
|
63 String HTML5 = "<!DOCTYPE HTML>"; |
|
64 checkValidHTML(HTML5); |
74 } |
65 } |
75 |
66 |
76 private static final String LOOSE = |
67 @Test |
77 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"; |
68 void test_html4() { |
|
69 // Test for all cases except the split index page |
|
70 javadoc("-d", "out-html4", |
|
71 "-html4", |
|
72 "-doctitle", "Document Title", |
|
73 "-windowtitle", "Window Title", |
|
74 "-use", |
|
75 "-overview", testSrc("overview.html"), |
|
76 "-sourcepath", testSrc, |
|
77 "p1", "p2"); |
|
78 checkExit(Exit.OK); |
|
79 String HTML4 = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"; |
|
80 |
|
81 checkValidHTML(HTML4); |
78 } |
82 } |
|
83 |
|
84 void checkValidHTML(String doctype) { |
|
85 // Test the proper DOCTYPE element are present: |
|
86 checkOutput("index.html", true, doctype); |
|
87 checkOutput("overview-summary.html", true, doctype); |
|
88 checkOutput("p1/package-summary.html", true, doctype); |
|
89 checkOutput("p1/C.html", true, doctype); |
|
90 checkOutput("overview-frame.html", true, doctype); |
|
91 checkOutput("allclasses-frame.html", true, doctype); |
|
92 checkOutput("p1/package-frame.html", true, doctype); |
|
93 } |
|
94 } |