protected String getDocumentWriteBuffer() { return jsGet_document().getWriteBuffer().toString(); }
public void jsSet_search( String newSearch ) throws SAXException, IOException { if (!newSearch.startsWith( "?" )) newSearch = '?' + newSearch; _window.setLocation( jsGet_protocol() + "//" + jsGet_host() + jsGet_pathname() + newSearch ); }
/** * 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() ); }
/** * initialize JavaScript for the given ScriptEngine * @parent - the Script Engine to use * @scriptable - the scriptable object to do the initialization for */ void initialize( JavaScriptEngine parent, ScriptableDelegate scriptable ) throws JavaScriptException, NotAFunctionException, PropertyException, SAXException { super.initialize( parent, scriptable ); _location = (Location) Context.getCurrentContext().newObject( this, "Location" ); _location.initialize(this, ((WebResponse.Scriptable) scriptable).getURL() ); _navigator = (Navigator) Context.getCurrentContext().newObject( this, "Navigator" ); _navigator.setClientProperties( getDelegate().getClientProperties() ); _screen = (Screen) Context.getCurrentContext().newObject( this, "Screen" ); _screen.setClientProperties( getDelegate().getClientProperties() ); }
public void jsSet_location( String relativeURL ) throws IOException, SAXException { setLocation( relativeURL ); }
public void jsSet_href( String urlString ) throws SAXException, IOException { _window.setLocation( urlString ); }
public void jsFunction_replace( String urlString ) throws IOException, SAXException { _window.setLocation( urlString ); }
public void jsSet_location( String relativeURL ) throws IOException, SAXException { setLocation( relativeURL ); }
public boolean jsFunction_confirm( String message ) { return getDelegate().getConfirmationResponse( message ); }
void setLocation( String relativeURL ) throws IOException, SAXException { getDelegate().setLocation( relativeURL ); }
/** * initialize JavaScript for the given ScriptEngine * @parent - the Script Engine to use * @scriptable - the scriptable object to do the initialization for */ void initialize( JavaScriptEngine parent, ScriptableDelegate scriptable ) throws JavaScriptException, NotAFunctionException, PropertyException, SAXException { super.initialize( parent, scriptable ); _location = (Location) Context.getCurrentContext().newObject( this, "Location" ); _location.initialize(this, ((WebResponse.Scriptable) scriptable).getURL() ); _navigator = (Navigator) Context.getCurrentContext().newObject( this, "Navigator" ); _navigator.setClientProperties( getDelegate().getClientProperties() ); _screen = (Screen) Context.getCurrentContext().newObject( this, "Screen" ); _screen.setClientProperties( getDelegate().getClientProperties() ); }
public void jsFunction_close() { getDelegate().closeWindow(); }
public void jsFunction_replace( String urlString ) throws IOException, SAXException { _window.setLocation( urlString ); }
public Object jsGet_location() { return _parent == null ? NOT_FOUND : getWindow().jsGet_location(); }
public Object jsGet_location() { return _parent == null ? NOT_FOUND : getWindow().jsGet_location(); }
protected void discardDocumentWriteBuffer() { jsGet_document().clearWriteBuffer(); }
public String jsFunction_prompt( String message, String defaultResponse ) { return getDelegate().getUserResponse( message, defaultResponse ); }
public String jsFunction_prompt( String message, String defaultResponse ) { return getDelegate().getUserResponse( message, defaultResponse ); }