[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit WebFrame.java,1.6,1.7
Brought to you by:
russgold
From: Russell G. <rus...@us...> - 2002-07-15 16:42:46
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv15189/src/com/meterware/httpunit Modified Files: WebFrame.java Log Message: Added support for _parent target Index: WebFrame.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebFrame.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- WebFrame.java 14 Feb 2002 14:33:49 -0000 1.6 +++ WebFrame.java 15 Jul 2002 16:42:44 -0000 1.7 @@ -58,8 +58,15 @@ static String getTargetFrameName( String sourceFrameName, final String relativeName ) { + if (relativeName.equalsIgnoreCase( "_parent" )) return getParentFrameName( sourceFrameName ); if (sourceFrameName.indexOf( ':' ) < 0) return relativeName; - return sourceFrameName.substring( 0, sourceFrameName.lastIndexOf( ':' ) ) + ':' + relativeName; + return getParentFrameName( sourceFrameName ) + ':' + relativeName; + } + + + static String getParentFrameName( String parentFrameName ) { + if (parentFrameName.indexOf( ':' ) < 0) return WebRequest.TOP_FRAME; + return parentFrameName.substring( 0, parentFrameName.lastIndexOf( ':' ) ); } |