/** * Entry point for embedded applications. This method attaches * to the global {@link ContextFactory} with a scope of a newly * created {@link Global} object. No I/O redirection is performed * as with {@link #main(String[])}. */ public static Dim mainEmbedded(String title) { ContextFactory factory = ContextFactory.getGlobal(); Global global = new Global(); global.init(factory); return mainEmbedded(factory, global, title); }
/** * Entry point for embedded applications. This method attaches * to the global {@link ContextFactory} with a scope of a newly * created {@link Global} object. No I/O redirection is performed * as with {@link #main(String[])}. */ public static Main mainEmbedded(String title) { ContextFactory factory = ContextFactory.getGlobal(); Global global = new Global(); global.init(factory); return mainEmbedded(factory, global, title); }
/** * Entry point for embedded applications. This method attaches * to the global {@link ContextFactory} with a scope of a newly * created {@link Global} object. No I/O redirection is performed * as with {@link #main(String[])}. */ public static Main mainEmbedded(String title) { ContextFactory factory = ContextFactory.getGlobal(); Global global = new Global(); global.init(factory); return mainEmbedded(factory, global, title); }
/** * Starts an interactive JavaScript debugger, and break at the next JavaScript execution. * * <p> * This is useful during debugging a test so that you can step execute and inspect state of JavaScript. * This will launch a Swing GUI, and the method returns immediately. * * <p> * Note that installing a debugger appears to make an execution of JavaScript substantially slower. * * <p> * TODO: because each script block evaluation in HtmlUnit is done in a separate Rhino context, * if you step over from one script block, the debugger fails to kick in on the beginning of the next script * block. * This makes it difficult to set a break point on arbitrary script block in the HTML page. We need to fix this * by tweaking {@link org.mozilla.javascript.tools.debugger.Dim.StackFrame#onLineChange(Context, int)}. */ public Dim interactiveJavaScriptDebugger() { Global global = new Global(); HtmlUnitContextFactory cf = ((JavaScriptEngine)getJavaScriptEngine()).getContextFactory(); global.init(cf); Dim dim = org.mozilla.javascript.tools.debugger.Main.mainEmbedded(cf, global, "Rhino debugger: " + testDescription.getDisplayName()); // break on exceptions. this catch most of the errors dim.setBreakOnExceptions(true); return dim; } }
/** * Starts an interactive JavaScript debugger, and break at the next JavaScript execution. * * <p> * This is useful during debugging a test so that you can step execute and inspect state of JavaScript. * This will launch a Swing GUI, and the method returns immediately. * * <p> * Note that installing a debugger appears to make an execution of JavaScript substantially slower. * * <p> * TODO: because each script block evaluation in HtmlUnit is done in a separate Rhino context, * if you step over from one script block, the debugger fails to kick in on the beginning of the next script block. * This makes it difficult to set a break point on arbitrary script block in the HTML page. We need to fix this * by tweaking {@link Dim.StackFrame#onLineChange(Context, int)}. */ public Dim interactiveJavaScriptDebugger() { Global global = new Global(); HtmlUnitContextFactory cf = ((JavaScriptEngine)getJavaScriptEngine()).getContextFactory(); global.init(cf); Dim dim = org.mozilla.javascript.tools.debugger.Main.mainEmbedded(cf, global, "Rhino debugger: " + getName()); // break on exceptions. this catch most of the errors dim.setBreakOnExceptions(true); return dim; } }
/** * Starts an interactive JavaScript debugger, and break at the next JavaScript execution. * * <p> * This is useful during debugging a test so that you can step execute and inspect state of JavaScript. * This will launch a Swing GUI, and the method returns immediately. * * <p> * Note that installing a debugger appears to make an execution of JavaScript substantially slower. * * <p> * TODO: because each script block evaluation in HtmlUnit is done in a separate Rhino context, * if you step over from one script block, the debugger fails to kick in on the beginning of the next script block. * This makes it difficult to set a break point on arbitrary script block in the HTML page. We need to fix this * by tweaking {@link Dim.StackFrame#onLineChange(Context, int)}. */ public Dim interactiveJavaScriptDebugger() { Global global = new Global(); HtmlUnitContextFactory cf = getJavaScriptEngine().getContextFactory(); global.init(cf); Dim dim = org.mozilla.javascript.tools.debugger.Main.mainEmbedded(cf, global, "Rhino debugger: " + getName()); // break on exceptions. this catch most of the errors dim.setBreakOnExceptions(true); return dim; } }
/** * Starts an interactive JavaScript debugger, and break at the next JavaScript execution. * * <p> * This is useful during debugging a test so that you can step execute and inspect state of JavaScript. * This will launch a Swing GUI, and the method returns immediately. * * <p> * Note that installing a debugger appears to make an execution of JavaScript substantially slower. * * <p> * TODO: because each script block evaluation in HtmlUnit is done in a separate Rhino context, * if you step over from one script block, the debugger fails to kick in on the beginning of the next script block. * This makes it difficult to set a break point on arbitrary script block in the HTML page. We need to fix this * by tweaking {@link Dim.StackFrame#onLineChange(Context, int)}. */ public Dim interactiveJavaScriptDebugger() { Global global = new Global(); HtmlUnitContextFactory cf = getJavaScriptEngine().getContextFactory(); global.init(cf); Dim dim = org.mozilla.javascript.tools.debugger.Main.mainEmbedded(cf, global, "Rhino debugger: " + getName()); // break on exceptions. this catch most of the errors dim.setBreakOnExceptions(true); return dim; } }
/** * Starts an interactive JavaScript debugger, and break at the next * JavaScript execution. * * <p> This is useful during debugging a test so that you can step * execute and inspect state of JavaScript. This will launch a Swing * GUI, and the method returns immediately. * * <p> Note that installing a debugger appears to make an execution of * JavaScript substantially slower. * * <p> TODO: because each script block evaluation in HtmlUnit is done in * a separate Rhino context, if you step over from one script block, the * debugger fails to kick in on the beginning of the next script block. * This makes it difficult to set a break point on arbitrary script * block in the HTML page. We need to fix this by tweaking * {@link Dim.StackFrame#onLineChange(Context, int)}. */ public Dim interactiveJavaScriptDebugger() { Global global = new Global(); HtmlUnitContextFactory cf = getJavaScriptEngine().getContextFactory(); global.init(cf); Dim dim = org.mozilla.javascript.tools.debugger.Main.mainEmbedded(cf, global, "Rhino debugger: " + getName()); // break on exceptions. this catch most of the errors dim.setBreakOnExceptions(true); return dim; } }