changeset 9517:bccedad1f44b

8144162: NullPointerException printed when loading webpage in WebView with anchor Reviewed-by: azvegint, kcr
author arajkumar
date Mon, 18 Jan 2016 09:38:51 +0300
parents 28341918c91e
children 23da5bee7c09
files modules/web/src/test/java/test/javafx/scene/web/MiscellaneousTest.java
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/web/src/test/java/test/javafx/scene/web/MiscellaneousTest.java	Sat Jan 16 08:38:38 2016 -0800
+++ b/modules/web/src/test/java/test/javafx/scene/web/MiscellaneousTest.java	Mon Jan 18 09:38:51 2016 +0300
@@ -111,6 +111,21 @@
                 "</script>");
     }
 
+    @Test public void testWebViewWithoutSceneGraph() {
+        submit(() -> {
+             WebEngine engine = new WebView().getEngine();
+             engine.getLoadWorker().stateProperty().addListener(
+                    (observable, oldValue, newValue) -> {
+                        if (State.SUCCEEDED == newValue) {
+                            engine.executeScript(
+                                "window.scrollTo" +
+                                "(0, document.documentElement.scrollHeight)");
+                        }
+                    });
+             engine.loadContent("<body> <a href=#>hello</a></body>");
+        });
+    }
+
     private WebEngine createWebEngine() {
         return submit(() -> new WebEngine());
     }