< prev index next >

modules/web/src/test/java/test/javafx/scene/web/MiscellaneousTest.java

Print this page




  92         submit(() -> {
  93             getEngine().getLoadWorker().stateProperty().addListener(listener);
  94         });
  95         String location = new File("src/test/resources/test/html/RT30835.html")
  96                 .toURI().toASCIIString().replaceAll("^file:/", "file:///");
  97         load(location);
  98         assertEquals(1, records.size());
  99         assertNotNull(records.get(0).document);
 100         assertEquals(location, records.get(0).location);
 101     }
 102 
 103     @Test public void testRT26306() {
 104         loadContent(
 105                 "<script language='javascript'>\n" +
 106                 "var s = '0123456789abcdef';\n" +
 107                 "while (true) {\n" +
 108                 "    alert(s.length);\n" +
 109                 "    s = s + s;\n" +
 110                 "}\n" +
 111                 "</script>");














 112     }
 113 
 114     private WebEngine createWebEngine() {
 115         return submit(() -> new WebEngine());
 116     }
 117 }


  92         submit(() -> {
  93             getEngine().getLoadWorker().stateProperty().addListener(listener);
  94         });
  95         String location = new File("src/test/resources/test/html/RT30835.html")
  96                 .toURI().toASCIIString().replaceAll("^file:/", "file:///");
  97         load(location);
  98         assertEquals(1, records.size());
  99         assertNotNull(records.get(0).document);
 100         assertEquals(location, records.get(0).location);
 101     }
 102 
 103     @Test public void testRT26306() {
 104         loadContent(
 105                 "<script language='javascript'>\n" +
 106                         "var s = '0123456789abcdef';\n" +
 107                         "while (true) {\n" +
 108                         "    alert(s.length);\n" +
 109                         "    s = s + s;\n" +
 110                         "}\n" +
 111                         "</script>");
 112     }
 113 
 114     @Test public void testJavaScriptDateParser() {
 115         // JDK-8146898 : Date object parsing failure
 116         submit(() -> {
 117             String dateFromString = (String) getEngine().
 118                     executeScript("(new Date('December 31, 2034 23:59:59')).toUTCString()");
 119 
 120             String dateFromInt = (String) getEngine().
 121                     executeScript("(new Date(2034, 11, 31, 23, 59, 59)).toUTCString()");
 122 
 123             assertEquals("JavaScript Date object parsing from String and Integer",
 124                     true, dateFromString.equalsIgnoreCase(dateFromInt));
 125         });
 126     }
 127 
 128     private WebEngine createWebEngine() {
 129         return submit(() -> new WebEngine());
 130     }
 131 }
< prev index next >