[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit WebRequestSource.java,1.25,1.26 WebWindow
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-03-24 15:04:50
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv14667/src/com/meterware/httpunit
Modified Files:
WebRequestSource.java WebWindow.java
Log Message:
Corrected javascript link which updates parent frame problem
Index: WebRequestSource.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebRequestSource.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- WebRequestSource.java 14 Mar 2003 17:41:29 -0000 1.25
+++ WebRequestSource.java 24 Mar 2003 15:04:31 -0000 1.26
@@ -205,8 +205,13 @@
protected WebResponse submitRequest( String event, final WebRequest request ) throws IOException, SAXException {
WebResponse response = null;
if (event.length() == 0 || getScriptableDelegate().doEvent( event )) response = submitRequest( request );
- if (response == null) response = getBaseResponse().getWindow().getFrameContents( getPageFrame() );
+ if (response == null) response = getCurrentFrame( getBaseResponse().getWindow(), getPageFrame() );
return response;
+ }
+
+
+ private WebResponse getCurrentFrame( WebWindow window, String pageFrame ) {
+ return window.hasFrame( pageFrame ) ? window.getFrameContents( pageFrame ) : window.getCurrentPage();
}
Index: WebWindow.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebWindow.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- WebWindow.java 16 Mar 2003 17:22:38 -0000 1.11
+++ WebWindow.java 24 Mar 2003 15:04:33 -0000 1.12
@@ -179,6 +179,14 @@
/**
+ * Returns true if the specified frame name is defined in this window.
+ */
+ public boolean hasFrame( String frameName ) {
+ return _frameContents.get( frameName ) != null;
+ }
+
+
+ /**
* Returns the response associated with the specified frame name.
* Throws a runtime exception if no matching frame is defined.
**/
@@ -239,6 +247,5 @@
&& response.getResponseCode() <= HttpURLConnection.HTTP_MOVED_TEMP
&& response.getHeaderField( "Location" ) != null;
}
-
}
|