[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit/javascript ScriptingTest.java,1.67,1.68
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2004-12-02 03:43:32
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25901/test/com/meterware/httpunit/javascript Modified Files: ScriptingTest.java Log Message: bug #1052779 window.open() with javascript URL no longer throws a null pointer exception or class cast exception Index: ScriptingTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- ScriptingTest.java 2 Dec 2004 00:54:59 -0000 1.67 +++ ScriptingTest.java 2 Dec 2004 03:43:20 -0000 1.68 @@ -128,6 +128,20 @@ } + public void testJavaScriptURLInNewWindow() throws Exception { + defineWebPage( "OnCommand", "<input type='button' id='nowindow' onClick='alert(\"hi\")'></input>\n" + + "<input type='button' id='withwindow' onClick=\"window.open('javascript:alert(\\'hi\\')','_self')\"></input>" ); + WebConversation wc = new WebConversation(); + WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" ); + Button button1 = (Button) response.getElementWithID( "nowindow" ); + Button button2 = (Button) response.getElementWithID( "withwindow" ); + button1.click(); + assertEquals( "Alert message 1", "hi", wc.popNextAlert() ); + button2.click(); + assertEquals( "Alert message 2", "hi", wc.popNextAlert() ); + } + + public void testSingleCommandOnLoad() throws Exception { defineResource( "OnCommand.html", "<html><head></head>" + "<body onLoad='alert(\"Ouch!\")'></body>" ); |