[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit/javascript FormScriptingTest.java,1.13,1
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-11-17 00:17:10
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript
In directory usw-pr-cvs1:/tmp/cvs-serv30543/test/com/meterware/httpunit/javascript
Modified Files:
FormScriptingTest.java
Log Message:
Wait until all frames are loaded before running embedded JavaScripts
Index: FormScriptingTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/FormScriptingTest.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- FormScriptingTest.java 31 Oct 2002 04:54:58 -0000 1.13
+++ FormScriptingTest.java 17 Nov 2002 00:17:07 -0000 1.14
@@ -646,4 +646,24 @@
}
+ public void testAccessAcrossFrames() throws Exception {
+ defineWebPage( "First", "<script language='JavaScript'>" +
+ " top.frame2.document.testform.param1.value = 'new1';" +
+ " window.alert('value: ' + top.frame2.document.testform.param1.value);" +
+ "</script>" );
+ defineWebPage( "Second", "<form method=post name=testform action='http://trinity/dummy'>" +
+ " <input type=hidden name='param1' value='old1'></form>" );
+ defineResource( "Frames.html",
+ "<html><head><title>Initial</title></head>" +
+ "<frameset cols=\"20%,80%\">" +
+ " <frame src='First.html' name='frame1'>" +
+ " <frame src='Second.html' name='frame2'>" +
+ "</frameset></html>" );
+
+ WebConversation wc = new WebConversation();
+ wc.getResponse( getHostPath() + "/Frames.html" );
+ assertEquals( "Alert message", "value: new1", wc.popNextAlert() );
+ }
+
+
}
|