[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit/javascript FrameScriptingTest.java,1.1,1
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-03-24 15:04:50
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript
In directory sc8-pr-cvs1:/tmp/cvs-serv14667/test/com/meterware/httpunit/javascript
Modified Files:
FrameScriptingTest.java
Log Message:
Corrected javascript link which updates parent frame problem
Index: FrameScriptingTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/FrameScriptingTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FrameScriptingTest.java 7 Mar 2003 05:04:03 -0000 1.1
+++ FrameScriptingTest.java 24 Mar 2003 15:04:33 -0000 1.2
@@ -176,5 +176,25 @@
assertEquals("Content of blue frame after clicking menu link", "Menu/Page/Target", _wc.getFrameContents("blue").getTitle());
}
+
+ /**
+ * Verifies that a javascript URL which triggers refresh to the parent of a frame resolves with something sensible.
+ */
+ public void testJavaScriptURLToParentFrame() throws Exception {
+ defineResource( "Frames.html",
+ "<HTML><HEAD><TITLE>Initial</TITLE></HEAD>" +
+ "<FRAMESET cols=\"20%,80%\">" +
+ " <FRAME src='Linker.html' name='red'>" +
+ " <FRAME src=Form name=blue>" +
+ "</FRAMESET></HTML>" );
+ defineWebPage( "Linker", "This is a trivial page with <a href='javascript:window.parent.location.replace( \"Target\" );'>one link</a>" );
+ defineResource( "Form", "This is a page with nothing we care about");
+ defineResource( "Target", "You made it!", "text/plain" );
+
+ _wc.getResponse( getHostPath() + "/Frames.html" );
+ WebResponse result = _wc.getFrameContents( "red" ).getLinkWith( "one link" ).click();
+ assertEquals( "Result of click", "You made it!", result.getText() );
+ }
+
private WebConversation _wc;
}
|