[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit/javascript DocumentScriptingTest.java,1.
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-11-17 16:43:44
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript
In directory usw-pr-cvs1:/tmp/cvs-serv24639/test/com/meterware/httpunit/javascript
Modified Files:
DocumentScriptingTest.java
Log Message:
Added support for Document.open / close
Index: DocumentScriptingTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/DocumentScriptingTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DocumentScriptingTest.java 6 Nov 2002 13:10:41 -0000 1.4
+++ DocumentScriptingTest.java 17 Nov 2002 16:43:41 -0000 1.5
@@ -271,5 +271,17 @@
}
+ public void testWriteToNewDocument() throws Exception {
+ defineWebPage( "OnCommand", "<a href='#' onclick=\"w = window.open( '', 'sample' );w.document.open( 'text/plain' ); w.document.write( 'You made it!' );w.document.close()\" >" );
+ WebConversation wc = new WebConversation();
+ WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" );
+ WebLink link = response.getLinks()[0];
+ link.click();
+ WebWindow ww = wc.getOpenWindow( "sample");
+ assertEquals( "Generated page", "You made it!", ww.getCurrentPage().getText() );
+ assertEquals( "Content Type", "text/plain", ww.getCurrentPage().getContentType() );
+ }
+
+
}
|