From: <no...@us...> - 2003-07-04 15:21:05
|
Log Message: ----------- Added support for the property Window.name Modified Files: -------------- /cvsroot/htmlunit/htmlunit/src/xdocs: changes.xml /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host: Window.java /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript: JavaScriptConfiguration.xml /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host: WindowTest.java Revision Data ------------- Index: Window.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Window.java 10 Jun 2003 11:57:00 -0000 1.20 +++ Window.java 4 Jul 2003 15:21:02 -0000 1.21 @@ -515,4 +515,8 @@ return ""; } + + public String jsGet_name() { + return webWindow_.getName(); + } } Index: JavaScriptConfiguration.xml =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptConfiguration.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- JavaScriptConfiguration.xml 28 May 2003 23:29:56 -0000 1.22 +++ JavaScriptConfiguration.xml 4 Jul 2003 15:21:02 -0000 1.23 @@ -281,6 +281,7 @@ <property name="frames" readable="true" writable="false"/> <property name="src" readable="true" writable="true"/> <property name="onload" readable="true" writable="true"/> + <property name="name" readable="true" writable="false"/> <function name="alert"/> <function name="blur"/> Index: changes.xml =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/xdocs/changes.xml,v retrieving revision 1.112 retrieving revision 1.113 diff -u -d -r1.112 -r1.113 --- changes.xml 28 Jun 2003 17:24:27 -0000 1.112 +++ changes.xml 4 Jul 2003 15:21:02 -0000 1.113 @@ -124,8 +124,11 @@ Changed HtmlTextArea.setText() to actually modify the DOM Patch provided by Barnaby Court. </action> - <action type="update" dev="mbowler" id="738548 "> + <action type="update" dev="mbowler" id="738548"> Fix for bug 738548 - "Form values are not Posted Properly to Server" + </action> + <action type="new" dev="mbowler"> + Added support for the property Window.name </action> </release> </body> Index: WindowTest.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/WindowTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- WindowTest.java 10 Jun 2003 11:57:01 -0000 1.2 +++ WindowTest.java 4 Jul 2003 15:21:02 -0000 1.3 @@ -105,6 +105,9 @@ final WebClient webClient = new WebClient(); final FakeWebConnection webConnection = new FakeWebConnection( webClient ); + final List collectedAlerts = new ArrayList(); + webClient.setAlertHandler( new CollectingAlertHandler(collectedAlerts) ); + final String firstContent = "<html><head><title>First</title></head><body>" + "<form name='form1'>" @@ -113,7 +116,9 @@ + "</form>" + "</body></html>"; final String secondContent - = "<html><head><title>Second</title></head><body></body></html>"; + = "<html><head><title>Second</title></head><body>" + + "<script>alert(self.name)</script>" + + "</body></html>"; final EventCatcher eventCatcher = new EventCatcher(); eventCatcher.listenTo( webClient ); @@ -149,6 +154,10 @@ final WebWindowEvent changedEvent = (WebWindowEvent)eventCatcher.getEventAt(2); assertNull( changedEvent.getOldPage() ); assertEquals( "Second", ((HtmlPage)changedEvent.getNewPage()).getTitleText() ); + + assertEquals( + Collections.singletonList("MyNewWindow"), + collectedAlerts); } |