[Httpunit-commit] SF.net SVN: httpunit: [929] trunk/httpunit
Brought to you by:
russgold
|
From: <wol...@us...> - 2008-04-19 11:32:13
|
Revision: 929
http://httpunit.svn.sourceforge.net/httpunit/?rev=929&view=rev
Author: wolfgang_fahl
Date: 2008-04-19 04:32:11 -0700 (Sat, 19 Apr 2008)
Log Message:
-----------
test case for bug report [ 1376739 ] iframe tag not recognized if Javascript code contains '<'
by Nathan Jakubiak added
The supplied patch unfortunately does not work and is therefore only added as a comment
Modified Paths:
--------------
trunk/httpunit/doc/release_notes.html
trunk/httpunit/src/com/meterware/httpunit/WebResponse.java
trunk/httpunit/test/com/meterware/httpunit/WebFrameTest.java
Modified: trunk/httpunit/doc/release_notes.html
===================================================================
--- trunk/httpunit/doc/release_notes.html 2008-04-19 10:46:48 UTC (rev 928)
+++ trunk/httpunit/doc/release_notes.html 2008-04-19 11:32:11 UTC (rev 929)
@@ -395,6 +395,17 @@
<li>improved
(<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=921">r921</a>)
</li>
+<ol>
+ <li>formatted extraction of subversion log with links
+ (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=922">r922</a>)
+ </li>
+ <li>PATCH proposal [ <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=1592532&group_id=6550&atid=106550">1592532</a> ] Invalid ServletUnitServletContext#getResource(String path)<br />by Timo Westk\xE4mper<br />add as comment while waiting for a JUnit testcase to be supplied
+ (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=927">r927</a>)
+ </li>
+ <li>test for bug report<br />[ <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=1232591&group_id=6550&atid=106550">1232591</a> ] getTarget() gives "_top" even if target is not present by Rifi added - no change yet
+ (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=928">r928</a>)
+ </li>
+</ol>
</ol>
<pre>
5-Jul-2007:
Modified: trunk/httpunit/src/com/meterware/httpunit/WebResponse.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/WebResponse.java 2008-04-19 10:46:48 UTC (rev 928)
+++ trunk/httpunit/src/com/meterware/httpunit/WebResponse.java 2008-04-19 11:32:11 UTC (rev 929)
@@ -1435,13 +1435,22 @@
ByteTag getNextTag() throws UnsupportedEncodingException {
- ByteTag byteTag;
+ ByteTag byteTag=null;
do {
- int start = _end + 1;
- while (start < _buffer.length && _buffer[ start ] != '<') start++;
- for (_end =start +1; _end < _buffer.length && _buffer[ _end ] != '>'; _end++);
- if (_end >= _buffer.length || _end < start) return null;
- byteTag = new ByteTag( _buffer, start +1, _end-start -1 );
+ int _start = _end + 1;
+ while (_start < _buffer.length && _buffer[ _start ] != '<') _start++;
+ // proposed patch for bug report
+ // [ 1376739 ] iframe tag not recognized if Javascript code contains '<'
+ // by Nathan Jakubiak
+ // uncommented since it doesn't seem to fix the test in WebFrameTest.java
+ // if (_scriptDepth > 0 && _start+1 < _buffer.length &&
+ // _buffer[ _start+1 ] != '/') {
+ // _end = _start+1;
+ // continue;
+ //}
+ for (_end =_start +1; _end < _buffer.length && _buffer[ _end ] != '>'; _end++);
+ if (_end >= _buffer.length || _end < _start) return null;
+ byteTag = new ByteTag( _buffer, _start +1, _end-_start -1 );
if (byteTag.getName().equalsIgnoreCase("script")) {
_scriptDepth++;
return byteTag;
Modified: trunk/httpunit/test/com/meterware/httpunit/WebFrameTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/httpunit/WebFrameTest.java 2008-04-19 10:46:48 UTC (rev 928)
+++ trunk/httpunit/test/com/meterware/httpunit/WebFrameTest.java 2008-04-19 11:32:11 UTC (rev 929)
@@ -427,6 +427,26 @@
assertNotNull( "Contents not found", contents );
assertEquals( "Number of links in iframe", 1, _wc.getFrameContents( "center" ).getLinks().length );
}
+
+ /**
+ * test bug report [ 1376739 ] iframe tag not recognized if Javascript code contains '<'
+ * by Nathan Jakubiak
+ * @throws Exception
+ */
+ public void testIFrameBug() throws Exception {
+ String html="\"<SCRIPT LANGUAGE=\"JavaScript\">\n"+
+ "var b = 0 < 1;\n"+
+ "</SCRIPT>\n"+
+ "<iframe name=\"iframe_after_lessthan_in_javascript\"\n"+
+ "src=\"c.html\"></iframe>";
+ defineWebPage( "iframe", html);
+ try {
+ WebResponse response = _wc.getFrameContents("iframe_after_lessthan_in_javascript");
+ assertTrue(response!=null);
+ } catch (Throwable th) {
+ this.warnDisabled("testIFrameBug", "patch needed for '"+th.getMessage()+"'");
+ }
+ }
/**
* test I Frame with a Form according to mail to mailinglist of 2008-03-25
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|