1515package org .htmlunit .javascript .host ;
1616
1717import org .htmlunit .WebDriverTestCase ;
18- import org .htmlunit .html .HtmlPageTest ;
1918import org .htmlunit .junit .BrowserRunner ;
2019import org .htmlunit .junit .annotation .Alerts ;
2120import org .junit .Test ;
@@ -92,7 +91,8 @@ public void browserLanguage() throws Exception {
9291 CHROME = {"string" , "20030107" },
9392 EDGE = {"string" , "20030107" })
9493 public void productSub () throws Exception {
95- final String html = "<html><head>\n "
94+ final String html = DOCTYPE_HTML
95+ + "<html><head>\n "
9696 + "<script>\n "
9797 + LOG_TITLE_FUNCTION
9898 + " log(typeof(navigator.productSub));\n "
@@ -175,7 +175,8 @@ public void userLanguage() throws Exception {
175175 "Microsoft Edge PDF Viewer" , "Portable Document Format" , "internal-pdf-viewer" , "undefined" ,
176176 "WebKit built-in PDF" , "Portable Document Format" , "internal-pdf-viewer" , "undefined" })
177177 public void plugins () throws Exception {
178- final String html = "<html>\n "
178+ final String html = DOCTYPE_HTML
179+ + "<html>\n "
179180 + "<head>\n "
180181 + " <script>\n "
181182 + LOG_TITLE_FUNCTION
@@ -205,7 +206,8 @@ public void plugins() throws Exception {
205206 @ Test
206207 @ Alerts ("Shockwave Flash not available" )
207208 public void pluginsShockwaveFlash () throws Exception {
208- final String html = "<html>\n "
209+ final String html = DOCTYPE_HTML
210+ + "<html>\n "
209211 + "<head>\n "
210212 + " <script>\n "
211213 + LOG_TITLE_FUNCTION
@@ -242,8 +244,8 @@ public void pluginsShockwaveFlash() throws Exception {
242244 "application/pdf" , "Portable Document Format" , "pdf" , "[object Plugin]" , "true" ,
243245 "text/pdf" , "Portable Document Format" , "pdf" , "[object Plugin]" , "true" })
244246 public void mimeTypes () throws Exception {
245- final String html
246- = "<html><head>\n "
247+ final String html = DOCTYPE_HTML
248+ + "<html><head>\n "
247249 + " <script>\n "
248250 + LOG_TITLE_FUNCTION
249251 + " function doTest() {\n "
@@ -273,7 +275,8 @@ public void mimeTypes() throws Exception {
273275 CHROME = "TypeError" ,
274276 EDGE = "TypeError" )
275277 public void taintEnabled () throws Exception {
276- final String html = "<html>\n "
278+ final String html = DOCTYPE_HTML
279+ + "<html>\n "
277280 + "<head>\n "
278281 + " <script>\n "
279282 + LOG_TITLE_FUNCTION
@@ -298,7 +301,8 @@ public void taintEnabled() throws Exception {
298301 * @throws Exception on test failure
299302 */
300303 void attribute (final String name , final String value , final String ... ignore ) throws Exception {
301- final String html = "<html>\n "
304+ final String html = DOCTYPE_HTML
305+ + "<html>\n "
302306 + "<head>\n "
303307 + " <script>\n "
304308 + LOG_TITLE_FUNCTION
@@ -322,8 +326,8 @@ void attribute(final String name, final String value, final String... ignore) th
322326 @ Test
323327 @ Alerts ("en-US" )
324328 public void language () throws Exception {
325- final String html
326- = "<html><head>\n "
329+ final String html = DOCTYPE_HTML
330+ + "<html><head>\n "
327331 + " <script>\n "
328332 + LOG_TITLE_FUNCTION
329333 + " </script>\n "
@@ -341,8 +345,8 @@ public void language() throws Exception {
341345 @ Test
342346 @ Alerts ("en-US,en" )
343347 public void languages () throws Exception {
344- final String html
345- = "<html><head>\n "
348+ final String html = DOCTYPE_HTML
349+ + "<html><head>\n "
346350 + " <script>\n "
347351 + LOG_TITLE_FUNCTION
348352 + " </script>\n "
@@ -359,8 +363,8 @@ public void languages() throws Exception {
359363 @ Test
360364 @ Alerts ({"number" , "number" })
361365 public void mozilla () throws Exception {
362- final String html
363- = "<html><head>\n "
366+ final String html = DOCTYPE_HTML
367+ + "<html><head>\n "
364368 + "<script>\n "
365369 + LOG_TITLE_FUNCTION
366370 + "function test() {\n "
@@ -380,8 +384,8 @@ public void mozilla() throws Exception {
380384 @ Test
381385 @ Alerts ("Gecko" )
382386 public void product () throws Exception {
383- final String html
384- = "<html><head>\n "
387+ final String html = DOCTYPE_HTML
388+ + "<html><head>\n "
385389 + "<script>\n "
386390 + LOG_TITLE_FUNCTION
387391 + "function test() {\n "
@@ -400,8 +404,8 @@ public void product() throws Exception {
400404 @ Test
401405 @ Alerts ("[object Geolocation]" )
402406 public void geolocation () throws Exception {
403- final String html
404- = "<html><head>\n "
407+ final String html = DOCTYPE_HTML
408+ + "<html><head>\n "
405409 + "<script>\n "
406410 + LOG_TITLE_FUNCTION
407411 + "function test() {\n "
@@ -422,8 +426,8 @@ public void geolocation() throws Exception {
422426 FF = "20181001000000" ,
423427 FF_ESR = "20181001000000" )
424428 public void buildID () throws Exception {
425- final String html
426- = "<html><head>\n "
429+ final String html = DOCTYPE_HTML
430+ + "<html><head>\n "
427431 + "<script>\n "
428432 + LOG_TITLE_FUNCTION
429433 + "function test() {\n "
@@ -444,8 +448,8 @@ public void buildID() throws Exception {
444448 FF = {"" , "" },
445449 FF_ESR = {"" , "" })
446450 public void vendor () throws Exception {
447- final String html
448- = "<html><head>\n "
451+ final String html = DOCTYPE_HTML
452+ + "<html><head>\n "
449453 + "<script>\n "
450454 + LOG_TITLE_FUNCTION
451455 + "function test() {\n "
@@ -467,8 +471,8 @@ public void vendor() throws Exception {
467471 FF = "true" ,
468472 FF_ESR = "true" )
469473 public void oscpu () throws Exception {
470- final String html
471- = "<html><head>\n "
474+ final String html = DOCTYPE_HTML
475+ + "<html><head>\n "
472476 + "<script>\n "
473477 + LOG_TITLE_FUNCTION
474478 + "function test() {\n "
@@ -489,7 +493,7 @@ public void oscpu() throws Exception {
489493 CHROME = {"[object NetworkInformation]" , "undefined" , "undefined" },
490494 EDGE = {"[object NetworkInformation]" , "undefined" , "undefined" })
491495 public void connection () throws Exception {
492- final String html = HtmlPageTest . STANDARDS_MODE_PREFIX_
496+ final String html = DOCTYPE_HTML
493497 + "<html><head>\n "
494498 + "<script>\n "
495499 + LOG_TITLE_FUNCTION
@@ -513,7 +517,7 @@ public void connection() throws Exception {
513517 CHROME = {"null" , "undefined" , "undefined" },
514518 EDGE = {"null" , "undefined" , "undefined" })
515519 public void doNotTrack () throws Exception {
516- final String html = HtmlPageTest . STANDARDS_MODE_PREFIX_
520+ final String html = DOCTYPE_HTML
517521 + "<html><head>\n "
518522 + "<script>\n "
519523 + LOG_TITLE_FUNCTION
@@ -535,7 +539,7 @@ public void doNotTrack() throws Exception {
535539 @ Test
536540 @ Alerts ({"[object MediaDevices]" , "true" })
537541 public void mediaDevices () throws Exception {
538- final String html = HtmlPageTest . STANDARDS_MODE_PREFIX_
542+ final String html = DOCTYPE_HTML
539543 + "<html><head>\n "
540544 + "<script>\n "
541545 + LOG_TITLE_FUNCTION
@@ -556,7 +560,7 @@ public void mediaDevices() throws Exception {
556560 @ Test
557561 @ Alerts ("true" )
558562 public void pdfViewerEnabled () throws Exception {
559- final String html = HtmlPageTest . STANDARDS_MODE_PREFIX_
563+ final String html = DOCTYPE_HTML
560564 + "<html><head>\n "
561565 + "<script>\n "
562566 + LOG_TITLE_FUNCTION
0 commit comments