@@ -53,7 +53,8 @@ public class AttachmentTest extends SimpleWebTestCase {
5353 */
5454 @ Test
5555 public void basic () throws Exception {
56- final String content1 = "<html><body>\n "
56+ final String content1 = DOCTYPE_HTML
57+ + "<html><body>\n "
5758 + "<form method='POST' name='form' action='" + URL_SECOND + "'>\n "
5859 + "<input type='submit' value='ok'>\n "
5960 + "</form>\n "
@@ -99,7 +100,8 @@ public void basic() throws Exception {
99100 */
100101 @ Test
101102 public void contentDispositionCaseInsensitive () throws Exception {
102- final String content1 = "<html><body>\n "
103+ final String content1 = DOCTYPE_HTML
104+ + "<html><body>\n "
103105 + "<form method='POST' name='form' action='" + URL_SECOND + "'>\n "
104106 + "<input type='submit' value='ok'>\n "
105107 + "</form>\n "
@@ -133,7 +135,7 @@ public void contentDispositionCaseInsensitive() throws Exception {
133135 */
134136 @ Test
135137 public void filename () throws Exception {
136- final String content = "<html>But is it really?</html>" ;
138+ final String content = DOCTYPE_HTML + "<html>But is it really?</html>" ;
137139
138140 final WebClient client = getWebClient ();
139141 final MockWebConnection conn = new MockWebConnection ();
@@ -191,7 +193,8 @@ public void filenameFromAnchor() throws Exception {
191193 final List <Attachment > attachments = new ArrayList <>();
192194 client .setAttachmentHandler (new CollectingAttachmentHandler (attachments ));
193195
194- final String content = "<html>\n "
196+ final String content = DOCTYPE_HTML
197+ + "<html>\n "
195198 + "<head>\n "
196199 + "<script>\n "
197200 + "var blob = new Blob(['foo'], {type: 'text/plain'}),\n "
@@ -222,7 +225,8 @@ public void filenameFromFile() throws Exception {
222225 final List <Attachment > attachments = new ArrayList <>();
223226 client .setAttachmentHandler (new CollectingAttachmentHandler (attachments ));
224227
225- final String content = "<html>\n "
228+ final String content = DOCTYPE_HTML
229+ + "<html>\n "
226230 + "<head>\n "
227231 + "<script>\n "
228232 + "var blob = new File(['bar'], 'bar.txt', {type: 'text/plain'}),\n "
@@ -255,7 +259,8 @@ public void filenameFromFilePrioritizeAnchorDownloadOverFileName() throws Except
255259 final List <Attachment > attachments = new ArrayList <>();
256260 client .setAttachmentHandler (new CollectingAttachmentHandler (attachments ));
257261
258- final String content = "<html>\n "
262+ final String content = DOCTYPE_HTML
263+ + "<html>\n "
259264 + "<head>\n "
260265 + "<script>\n "
261266 + "var blob = new File(['bar'], 'bar.txt', {type: 'text/plain'}),\n "
@@ -282,7 +287,8 @@ public void filenameFromFilePrioritizeAnchorDownloadOverFileName() throws Except
282287 */
283288 @ Test
284289 public void jsChangeLocationAfterReceptionOfAttachment () throws Exception {
285- final String html = "<html><body>\n "
290+ final String html = DOCTYPE_HTML
291+ + "<html><body>\n "
286292 + "<form action='action'>\n "
287293 + "<input type='submit' onclick='window.location=\" foo\" ; return false'>\n "
288294 + "</form>\n "
@@ -315,7 +321,8 @@ public void jsChangeLocationAfterReceptionOfAttachment() throws Exception {
315321 */
316322 @ Test
317323 public void handleResponseFromHandler () throws Exception {
318- final String content1 = "<html><body>\n "
324+ final String content1 = DOCTYPE_HTML
325+ + "<html><body>\n "
319326 + "<form method='POST' name='form' action='" + URL_SECOND + "'>\n "
320327 + "<input type='submit' value='ok'>\n "
321328 + "</form>\n "
@@ -375,7 +382,8 @@ public void handleAttachment(final Page page, final String attachmentFilename) {
375382 */
376383 @ Test
377384 public void handleResponseFromHandlerWithFileName () throws Exception {
378- final String content1 = "<html><body>\n "
385+ final String content1 = DOCTYPE_HTML
386+ + "<html><body>\n "
379387 + "<form method='POST' name='form' action='" + URL_SECOND + "'>\n "
380388 + "<input type='submit' value='ok'>\n "
381389 + "</form>\n "
@@ -435,7 +443,8 @@ public void handleAttachment(final Page page, final String attachmentFilename) {
435443 */
436444 @ Test
437445 public void handleResponseOnlyApplicationOctetstream () throws Exception {
438- final String content1 = "<html><body>\n "
446+ final String content1 = DOCTYPE_HTML
447+ + "<html><body>\n "
439448 + "<form method='POST' name='form' action='" + URL_SECOND + "'>\n "
440449 + "<input type='submit' value='ok'>\n "
441450 + "</form>\n "
0 commit comments