[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit/javascript ScriptingTest.java,1.53,1.54
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-10-02 01:17:09
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript
In directory sc8-pr-cvs1:/tmp/cvs-serv13727/test/com/meterware/httpunit/javascript
Modified Files:
ScriptingTest.java
Log Message:
from Patrick Lightbody: support HTMLElement.style.display
Index: ScriptingTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- ScriptingTest.java 23 May 2003 03:24:50 -0000 1.53
+++ ScriptingTest.java 2 Oct 2003 00:04:57 -0000 1.54
@@ -579,6 +579,33 @@
}
+ public void testStyleProperty() throws Exception {
+ defineResource( "start.html",
+ "<html><head><script language='JavaScript'>" +
+ "function showDisplay( id ) {" +
+ " var element = document.getElementById( id );\n" +
+ " alert( 'element with id ' + id + ' has style.display ' + element.style.display );\n" +
+ "}\n" +
+ "function swapDisplay( id ) {" +
+ " var element = document.getElementById( id );\n" +
+ " element.style.display = !element.style.display;\n" +
+ "}\n" +
+ "function doAll() {\n" +
+ " showDisplay('test');\n" +
+ " swapDisplay('test'); \n" +
+ " showDisplay('test');\n" +
+ "}\n" +
+ "</script>" +
+ "</head><body onLoad='doAll();'>" +
+ "<div id='test'>foo</div></body></html>" );
+ WebConversation wc = new WebConversation();
+ wc.getResponse( getHostPath() + "/start.html" );
+
+ assertEquals( "element with id test has style.display true", wc.popNextAlert() );
+ assertEquals( "element with id test has style.display false", wc.popNextAlert() );
+ }
+
+
public void testSimpleSetCookie() throws Exception {
defineResource( "OnCommand.html", "<html><head></head>\n" +
"<body onLoad='document.cookie=\"color=red;path=/\"'>\n" +
|