Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript
In directory usw-pr-cvs1:/tmp/cvs-serv24618/test/com/meterware/httpunit/javascript
Modified Files:
ScriptingTest.java
Log Message:
Treat form, image, and link names as case-sensitive in JavaScript
Index: ScriptingTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- ScriptingTest.java 13 Sep 2002 18:34:58 -0000 1.22
+++ ScriptingTest.java 25 Sep 2002 16:20:53 -0000 1.23
@@ -267,6 +267,24 @@
}
+ public void testCaseSensitiveNames() throws Exception {
+ defineResource( "OnCommand.html", "<html><head></head>" +
+ "<body>" +
+ "<form name='item' action='run'></form>" +
+ "<a name='Item' href='sample.html'></a>" +
+ "<a href='#' name='first' onMouseOver='alert( document.item.action );'>1</a>" +
+ "<a href='#' name='second' onMouseOver='alert( document.Item.href );'>2</a>" +
+ "</body></html>" );
+ WebConversation wc = new WebConversation();
+ WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" );
+ WebForm form = response.getFormWithName( "realform" );
+ response.getLinkWithName( "first" ).mouseOver();
+ assertEquals( "form action", "run", wc.popNextAlert() );
+ response.getLinkWithName( "second" ).mouseOver();
+ assertEquals( "link href", getHostPath() + "/sample.html", wc.popNextAlert() );
+ }
+
+
public void testLinkMouseOverEvent() throws Exception {
defineResource( "OnCommand.html", "<html><head></head>" +
"<body>" +
|