[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit WebResponse.java,1.109,1.110
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-02-23 20:03:43
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv32315/src/com/meterware/httpunit
Modified Files:
WebResponse.java
Log Message:
Ignore document.close() while processing immediate script
Index: WebResponse.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebResponse.java,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- WebResponse.java 14 Feb 2003 19:04:24 -0000 1.109
+++ WebResponse.java 23 Feb 2003 20:03:38 -0000 1.110
@@ -52,6 +52,7 @@
private boolean _hasSubframes;
private URL _baseURL;
private String _baseTarget;
+ private boolean _parsingPage;
/**
@@ -730,6 +731,7 @@
void replaceText( String text, String contentType ) {
+ if (_parsingPage) return;
_responseText = text;
_inputStream = null;
_page = null;
@@ -937,12 +939,16 @@
private HTMLPage getReceivedPage() throws SAXException {
if (_page == null) {
try {
+ _parsingPage = true;
if (!isHTML()) throw new NotHTMLException( getContentType() );
_page = new HTMLPage( this, _frameName, _baseURL, _baseTarget, getCharacterSet() );
_page.parse( getText(), _pageURL );
+ if (_page == null) throw new IllegalStateException( "replaceText called in the middle of getReceivedPage()" );
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException( e.toString() );
+ } finally {
+ _parsingPage = false;
}
}
return _page;
|