/** * Initiates JavaScript execution for the specified web response. */ public static void run( WebResponse response ) throws IllegalAccessException, InstantiationException, InvocationTargetException, ClassDefinitionException, NotAFunctionException, PropertyException, SAXException, JavaScriptException { Context context = Context.enter(); // suggest bug fix for large java scripts see // bug report [ 1216567 ] Exception for large javascripts // by Grzegorz Lukasik // and context.setOptimizationLevel(HttpUnitOptions.getJavaScriptOptimizationLevel()); Scriptable scope = context.initStandardObjects( null ); initHTMLObjects( scope ); Window w = (Window) context.newObject( scope, "Window" ); w.initialize( null, response.getScriptableObject() ); }
/** * Initiates JavaScript execution for the specified web response. */ public static void run( WebResponse response ) throws IllegalAccessException, InstantiationException, InvocationTargetException, ClassDefinitionException, NotAFunctionException, PropertyException, SAXException, JavaScriptException { Context context = Context.enter(); // suggest bug fix for large java scripts see // bug report [ 1216567 ] Exception for large javascripts // by Grzegorz Lukasik // and context.setOptimizationLevel(HttpUnitOptions.getJavaScriptOptimizationLevel()); Scriptable scope = context.initStandardObjects( null ); initHTMLObjects( scope ); Window w = (Window) context.newObject( scope, "Window" ); w.initialize( null, response.getScriptableObject() ); }
/** * Initiates JavaScript execution for the specified web response. */ public static void run( WebResponse response ) throws IllegalAccessException, InstantiationException, InvocationTargetException, ClassDefinitionException, NotAFunctionException, PropertyException, SAXException, JavaScriptException { Context context = Context.enter(); // suggest bug fix for large java scripts see // bug report [ 1216567 ] Exception for large javascripts // by Grzegorz Lukasik // and context.setOptimizationLevel(HttpUnitOptions.getJavaScriptOptimizationLevel()); Scriptable scope = context.initStandardObjects( null ); initHTMLObjects( scope ); Window w = (Window) context.newObject( scope, "Window" ); w.initialize( null, response.getScriptableObject() ); }