You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
(30) |
Sep
(15) |
Oct
(26) |
Nov
(12) |
Dec
(17) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(7) |
Feb
(27) |
Mar
(73) |
Apr
(17) |
May
(17) |
Jun
(78) |
Jul
(67) |
Aug
(60) |
Sep
(89) |
Oct
(140) |
Nov
(173) |
Dec
(46) |
2004 |
Jan
(39) |
Feb
(7) |
Mar
(21) |
Apr
(31) |
May
(13) |
Jun
(86) |
Jul
(14) |
Aug
(14) |
Sep
(53) |
Oct
(184) |
Nov
(186) |
Dec
(319) |
2005 |
Jan
(336) |
Feb
(274) |
Mar
(226) |
Apr
(102) |
May
(196) |
Jun
(130) |
Jul
(119) |
Aug
(143) |
Sep
(76) |
Oct
(85) |
Nov
(70) |
Dec
(159) |
2006 |
Jan
(125) |
Feb
(100) |
Mar
(80) |
Apr
(39) |
May
(55) |
Jun
(58) |
Jul
(50) |
Aug
(76) |
Sep
(55) |
Oct
(101) |
Nov
(163) |
Dec
(85) |
2007 |
Jan
(56) |
Feb
(53) |
Mar
(180) |
Apr
(221) |
May
(290) |
Jun
(199) |
Jul
(322) |
Aug
(515) |
Sep
(121) |
Oct
(297) |
Nov
(177) |
Dec
(103) |
2008 |
Jan
(516) |
Feb
(315) |
Mar
(586) |
Apr
(615) |
May
(197) |
Jun
(381) |
Jul
(390) |
Aug
(195) |
Sep
(603) |
Oct
(499) |
Nov
(622) |
Dec
(350) |
2009 |
Jan
(313) |
Feb
(338) |
Mar
(507) |
Apr
(317) |
May
(197) |
Jun
(375) |
Jul
(235) |
Aug
(424) |
Sep
(410) |
Oct
(338) |
Nov
(286) |
Dec
(306) |
2010 |
Jan
(367) |
Feb
(339) |
Mar
(371) |
Apr
(172) |
May
(233) |
Jun
(264) |
Jul
(421) |
Aug
(110) |
Sep
(218) |
Oct
(189) |
Nov
(185) |
Dec
(168) |
2011 |
Jan
(145) |
Feb
(213) |
Mar
(205) |
Apr
(64) |
May
(159) |
Jun
(67) |
Jul
(104) |
Aug
(126) |
Sep
(144) |
Oct
(106) |
Nov
(154) |
Dec
(225) |
2012 |
Jan
(111) |
Feb
(87) |
Mar
(131) |
Apr
(102) |
May
(180) |
Jun
(160) |
Jul
(412) |
Aug
(315) |
Sep
(311) |
Oct
(369) |
Nov
(464) |
Dec
(284) |
2013 |
Jan
(343) |
Feb
(165) |
Mar
(174) |
Apr
(120) |
May
(153) |
Jun
(134) |
Jul
(202) |
Aug
(105) |
Sep
(228) |
Oct
(332) |
Nov
(192) |
Dec
(219) |
2014 |
Jan
(348) |
Feb
(194) |
Mar
(189) |
Apr
(188) |
May
(297) |
Jun
(206) |
Jul
(79) |
Aug
(279) |
Sep
(111) |
Oct
(159) |
Nov
(61) |
Dec
(78) |
2015 |
Jan
(152) |
Feb
(145) |
Mar
(239) |
Apr
(223) |
May
(248) |
Jun
(296) |
Jul
(172) |
Aug
(189) |
Sep
(338) |
Oct
(217) |
Nov
(131) |
Dec
(184) |
2016 |
Jan
(118) |
Feb
(221) |
Mar
(414) |
Apr
(412) |
May
(303) |
Jun
(133) |
Jul
(129) |
Aug
(121) |
Sep
(136) |
Oct
(67) |
Nov
(89) |
Dec
(245) |
2017 |
Jan
(349) |
Feb
(90) |
Mar
(328) |
Apr
(430) |
May
(284) |
Jun
(199) |
Jul
(164) |
Aug
(120) |
Sep
(57) |
Oct
(105) |
Nov
(108) |
Dec
(146) |
2018 |
Jan
(85) |
Feb
(48) |
Mar
(97) |
Apr
(62) |
May
(64) |
Jun
(136) |
Jul
(123) |
Aug
(87) |
Sep
(17) |
Oct
(27) |
Nov
(9) |
Dec
(16) |
2019 |
Jan
(9) |
Feb
(17) |
Mar
(18) |
Apr
(14) |
May
(8) |
Jun
|
Jul
(6) |
Aug
(12) |
Sep
(5) |
Oct
|
Nov
(2) |
Dec
|
2020 |
Jan
(8) |
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
(4) |
Oct
(1) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(4) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2023 |
Jan
|
Feb
(6) |
Mar
(9) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
1
(18) |
2
(15) |
3
|
4
|
5
(18) |
6
(2) |
7
(2) |
8
(3) |
9
|
10
|
11
|
12
(1) |
13
|
14
(1) |
15
|
16
(1) |
17
|
18
|
19
|
20
(1) |
21
|
22
|
23
(2) |
24
|
25
(15) |
26
(4) |
27
(4) |
28
(4) |
29
(5) |
30
(2) |
31
(7) |
From: <rb...@us...> - 2013-08-07 16:20:29
|
Revision: 8443 http://sourceforge.net/p/htmlunit/code/8443 Author: rbri Date: 2013-08-07 16:20:25 +0000 (Wed, 07 Aug 2013) Log Message: ----------- selenium driver updated to 2.34 Modified Paths: -------------- trunk/htmlunit/pom.xml Modified: trunk/htmlunit/pom.xml =================================================================== --- trunk/htmlunit/pom.xml 2013-08-06 15:28:16 UTC (rev 8442) +++ trunk/htmlunit/pom.xml 2013-08-07 16:20:25 UTC (rev 8443) @@ -875,7 +875,7 @@ <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-htmlunit-driver</artifactId> - <version>2.33.0</version> + <version>2.34.0</version> <scope>test</scope> <exclusions> <exclusion> @@ -887,19 +887,19 @@ <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-ie-driver</artifactId> - <version>2.33.0</version> + <version>2.34.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-firefox-driver</artifactId> - <version>2.33.0</version> + <version>2.34.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-chrome-driver</artifactId> - <version>2.33.0</version> + <version>2.34.0</version> <scope>test</scope> </dependency> <dependency> |
From: <bui...@ca...> - 2013-08-06 17:00:13
|
<html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>CruiseControl Build Result</title> </head> <body> <h1 xmlns:xslt="http://xml.apache.org/xslt">BUILD COMPLETE - build.2370</h1> <table> <tr> <th>Date of build</th><td>08/06/2013 17:30:17</td> </tr> <tr> <th>Time to build</th><td>89 minute(s) 37 second(s)</td> </tr> <tr> <th>Last changed</th><td>08/06/2013 17:28:16</td> </tr> <tr> <th>Last log entry</th><td>force build (rbri) </td> </tr> </table> <h2>Unit Tests</h2> <p>Test cases: <b>17723</b>, passed: <b>17723</b>, failures: <b>0</b>, errors: <b>0</b>.</p> <table cellpadding="0" cellspacing="0" bgcolor="white" id="utests"> <tr> <td bgcolor="green" width="100%"> </td> </tr> </table> <h2>Modifications</h2> <p>5 modifications since last build.</p> <h3>rbri: window.postMessage is synchronous in IE only (08/05/2013 19:42:58)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java</li> </ul> <h3>rbri: force build (08/05/2013 22:43:21)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/force.build</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/force.build</li> </ul> </body> </html> |
From: <rb...@us...> - 2013-08-06 15:28:20
|
Revision: 8442 http://sourceforge.net/p/htmlunit/code/8442 Author: rbri Date: 2013-08-06 15:28:16 +0000 (Tue, 06 Aug 2013) Log Message: ----------- force build Modified Paths: -------------- trunk/htmlunit/force.build Modified: trunk/htmlunit/force.build =================================================================== --- trunk/htmlunit/force.build 2013-08-05 20:43:21 UTC (rev 8441) +++ trunk/htmlunit/force.build 2013-08-06 15:28:16 UTC (rev 8442) @@ -1 +1 @@ -20 \ No newline at end of file +21 \ No newline at end of file |
From: <bui...@ca...> - 2013-08-05 22:18:04
|
<html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>CruiseControl Build Result</title> </head> <body> <h1 xmlns:xslt="http://xml.apache.org/xslt">BUILD FAILED</h1> <table> <tr> <th>Date of build</th><td>08/05/2013 22:48:01</td> </tr> <tr> <th>Time to build</th><td>89 minute(s) 45 second(s)</td> </tr> <tr> <th>Last changed</th><td>08/05/2013 22:43:21</td> </tr> <tr> <th>Last log entry</th><td>force build (rbri) </td> </tr> </table> <h2>Ant Error Message</h2> <pre>Return code is 1</pre> <pre></pre> <h2>Unit Tests</h2> <p>Test cases: <b>17723</b>, passed: <b>17721</b>, failures: <b>2</b>, errors: <b>0</b>.</p> <table cellpadding="0" cellspacing="0" bgcolor="white" id="utests"> <tr> <td bgcolor="green" width="99.98871522879874%"> </td><td bgcolor="#FFFFA0" width="0.011284771201263895%"> </td> </tr> </table> <h3>Failures</h3> <ul> <li class="oddrow">setInterval</li> <li class="evenrow">WebSocketTest.chat [FF17]</li> </ul> <h3>Unit Test Error Details: (2)</h3> <h4>Test: setInterval</h4> <p>Type: java.lang.AssertionError</p> <p>Message: expected:<0> but was:<1></p> <PRE> </PRE> <h4>Test: WebSocketTest.chat [FF17]</h4> <p>Type: org.junit.ComparisonFailure</p> <p>Message: expected:<[Browser: has joined!]> but was:<[]></p> <PRE> </PRE> <h2>Modifications</h2> <p>4 modifications since last build.</p> <h3>rbri: window.postMessage is synchronous in IE only (08/05/2013 19:42:58)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java</li> </ul> <h3>rbri: force build (08/05/2013 22:43:21)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/force.build</li> </ul> </body> </html> |
From: <rb...@us...> - 2013-08-05 20:43:25
|
Revision: 8441 http://sourceforge.net/p/htmlunit/code/8441 Author: rbri Date: 2013-08-05 20:43:21 +0000 (Mon, 05 Aug 2013) Log Message: ----------- force build Modified Paths: -------------- trunk/htmlunit/force.build Modified: trunk/htmlunit/force.build =================================================================== --- trunk/htmlunit/force.build 2013-08-05 17:42:58 UTC (rev 8440) +++ trunk/htmlunit/force.build 2013-08-05 20:43:21 UTC (rev 8441) @@ -1 +1 @@ -19 \ No newline at end of file +20 \ No newline at end of file |
From: <bui...@ca...> - 2013-08-05 20:02:51
|
<html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>CruiseControl Build Result</title> </head> <body> <h1 xmlns:xslt="http://xml.apache.org/xslt">BUILD FAILED</h1> <table> <tr> <th>Date of build</th><td>08/05/2013 20:20:24</td> </tr> <tr> <th>Time to build</th><td>102 minute(s) 1 second(s)</td> </tr> <tr> <th>Last changed</th><td>08/05/2013 19:42:58</td> </tr> <tr> <th>Last log entry</th><td>window.postMessage is synchronous in IE only (rbri) </td> </tr> </table> <h2>Ant Error Message</h2> <pre>Return code is 1</pre> <pre></pre> <h2>Unit Tests</h2> <p>Test cases: <b>17723</b>, passed: <b>17721</b>, failures: <b>2</b>, errors: <b>0</b>.</p> <table cellpadding="0" cellspacing="0" bgcolor="white" id="utests"> <tr> <td bgcolor="green" width="99.98871522879874%"> </td><td bgcolor="#FFFFA0" width="0.011284771201263895%"> </td> </tr> </table> <h3>Failures</h3> <ul> <li class="oddrow">waitForComplexJobs</li> <li class="evenrow">waitForJobs_complexJobs</li> </ul> <h3>Unit Test Error Details: (2)</h3> <h4>Test: waitForComplexJobs</h4> <p>Type: java.lang.AssertionError</p> <p>Message: expected:<1> but was:<2></p> <PRE> </PRE> <h4>Test: waitForJobs_complexJobs</h4> <p>Type: java.lang.AssertionError</p> <p>Message: expected:<2> but was:<0></p> <PRE> </PRE> <h2>Modifications</h2> <p>3 modifications since last build.</p> <h3>rbri: window.postMessage is synchronous in IE only (08/05/2013 19:42:58)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java</li> </ul> </body> </html> |
From: <rb...@us...> - 2013-08-05 17:43:02
|
Revision: 8440 http://sourceforge.net/p/htmlunit/code/8440 Author: rbri Date: 2013-08-05 17:42:58 +0000 (Mon, 05 Aug 2013) Log Message: ----------- window.postMessage is synchronous in IE only Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2013-08-05 16:39:28 UTC (rev 8439) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2013-08-05 17:42:58 UTC (rev 8440) @@ -1170,6 +1170,10 @@ @BrowserFeature(@WebBrowser(IE)) JS_WINDOW_IS_NOT_A_FUNCTION, + /** Window.postMessage is synchronouse. */ + @BrowserFeature(@WebBrowser(IE)) + JS_WINDOW_POST_MESSAGE_SYNCHRONOUSE, + /** Supports XML. */ @BrowserFeature({ @WebBrowser(FF), @WebBrowser(CHROME) }) JS_XML, Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-08-05 16:39:28 UTC (rev 8439) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-08-05 17:42:58 UTC (rev 8440) @@ -20,6 +20,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_CHANGE_OPENER_NOT_ALLOWED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_FRAMES_ACCESSIBLE_BY_ID; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_IS_NOT_A_FUNCTION; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_POST_MESSAGE_SYNCHRONOUSE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML_SUPPORT_VIA_ACTIVEXOBJECT; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; @@ -81,6 +82,7 @@ import com.gargoylesoftware.htmlunit.html.HtmlLink; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlStyle; +import com.gargoylesoftware.htmlunit.javascript.PostponedAction; import com.gargoylesoftware.htmlunit.javascript.ScriptableWithFallbackGetter; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.background.BackgroundJavaScriptFactory; @@ -2051,7 +2053,18 @@ event.setParentScope(this); event.setPrototype(getPrototype(event.getClass())); - dispatchEvent(event); + if (getBrowserVersion().hasFeature(JS_WINDOW_POST_MESSAGE_SYNCHRONOUSE)) { + dispatchEvent(event); + return; + } + + final PostponedAction action = new PostponedAction(getDomNodeOrDie().getPage()) { + @Override + public void execute() throws Exception { + dispatchEvent(event); + } + }; + getWebWindow().getWebClient().getJavaScriptEngine().addPostponedAction(action); } } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2013-08-05 16:39:28 UTC (rev 8439) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2013-08-05 17:42:58 UTC (rev 8440) @@ -38,6 +38,7 @@ * @version $Revision$ * @author Marc Guillemot * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserRunner.class) public class Window2Test extends WebDriverTestCase { @@ -1171,22 +1172,25 @@ IE6 = "exception", IE7 = "exception") public void postMessage() throws Exception { final String html - = "<html><body><script>\n" - + "function receiveMessage(event) {\n" - + " alert('type: ' + event.type);\n" - + " alert('data: ' + event.data);\n" - // + " alert('origin: ' + event.origin);\n" - // + " alert('source: ' + event.source);\n" - // + " alert('lastEventId: ' + event.lastEventId);\n" - + "}\n" - + "if (window.addEventListener) {\n" - + " window.addEventListener('message', receiveMessage, false);\n" - + "}\n" - + "else {\n" - + " window.attachEvent('onmessage', receiveMessage);\n" - + "}\n" + = "<html>" + + "<head><title>foo</title></head>\n" + + "<body>\n" + + "<script>\n" + + " function receiveMessage(event) {\n" + + " alert('type: ' + event.type);\n" + + " alert('data: ' + event.data);\n" + // + " alert('origin: ' + event.origin);\n" + // + " alert('source: ' + event.source);\n" + // + " alert('lastEventId: ' + event.lastEventId);\n" + + " }\n" + + + " if (window.addEventListener) {\n" + + " window.addEventListener('message', receiveMessage, false);\n" + + " } else {\n" + + " window.attachEvent('onmessage', receiveMessage);\n" + + " }\n" + "</script>\n" - + "<iframe src='" + URL_SECOND + "'></iframe>\n" + + " <iframe src='" + URL_SECOND + "'></iframe>\n" + "</body></html>"; final String iframe = "<html><body><script>\n" @@ -1198,4 +1202,42 @@ getMockWebConnection().setResponse(URL_SECOND, iframe); loadPageWithAlerts2(html); } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "sync: false", + IE6 = "exception", + IE7 = "exception", + IE = "sync: true") + public void postMessageSyncOrAsync() throws Exception { + final String html + = "<html>" + + "<head><title>foo</title></head>\n" + + "<body>\n" + + "<script>\n" + + " var sync = true;\n" + + " function receiveMessage(event) {\n" + + " alert('sync: ' + sync);\n" + + " }\n" + + " if (window.addEventListener) {\n" + + " window.addEventListener('message', receiveMessage, false);\n" + + " } else {\n" + + " window.attachEvent('onmessage', receiveMessage);\n" + + " }\n" + + "</script>\n" + + " <iframe src='" + URL_SECOND + "'></iframe>\n" + + "</body></html>"; + + final String iframe = "<html><body><script>\n" + + "try {\n" + + " top.postMessage('hello', '*');\n" + + " top.sync = false;\n" + + "} catch(e) { alert('exception') }\n" + + "</script></body></html>"; + + getMockWebConnection().setResponse(URL_SECOND, iframe); + loadPageWithAlerts2(html); + } } |
From: <rb...@us...> - 2013-08-05 16:39:31
|
Revision: 8439 http://sourceforge.net/p/htmlunit/code/8439 Author: rbri Date: 2013-08-05 16:39:28 +0000 (Mon, 05 Aug 2013) Log Message: ----------- postMessage is available in real IE 8 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-08-05 16:38:47 UTC (rev 8438) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-08-05 16:39:28 UTC (rev 8439) @@ -2045,7 +2045,7 @@ * @param targetOrigin the origin this window must be for the event to be dispatched * @see <a href="https://developer.mozilla.org/en-US/docs/Web/API/window.postMessage">MDN documentation</a> */ - @JsxFunction({@WebBrowser(FF), @WebBrowser(CHROME), @WebBrowser(value = IE, minVersion = 9) }) + @JsxFunction({@WebBrowser(FF), @WebBrowser(CHROME), @WebBrowser(value = IE, minVersion = 8) }) public void postMessage(final String message, final String targetOrigin) { final MessageEvent event = new MessageEvent(message); event.setParentScope(this); Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2013-08-05 16:38:47 UTC (rev 8438) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2013-08-05 16:39:28 UTC (rev 8439) @@ -1168,13 +1168,16 @@ */ @Test @Alerts(DEFAULT = { "type: message", "data: hello" }, - IE6 = "exception", IE7 = "exception", IE8 = "exception") + IE6 = "exception", IE7 = "exception") public void postMessage() throws Exception { final String html = "<html><body><script>\n" + "function receiveMessage(event) {\n" + " alert('type: ' + event.type);\n" + " alert('data: ' + event.data);\n" + // + " alert('origin: ' + event.origin);\n" + // + " alert('source: ' + event.source);\n" + // + " alert('lastEventId: ' + event.lastEventId);\n" + "}\n" + "if (window.addEventListener) {\n" + " window.addEventListener('message', receiveMessage, false);\n" @@ -1188,7 +1191,7 @@ final String iframe = "<html><body><script>\n" + "try {\n" - + "top.postMessage('hello', '*');\n" + + " top.postMessage('hello', '*');\n" + "} catch(e) { alert('exception') }\n" + "</script></body></html>"; |
From: <rb...@us...> - 2013-08-05 16:38:50
|
Revision: 8438 http://sourceforge.net/p/htmlunit/code/8438 Author: rbri Date: 2013-08-05 16:38:47 +0000 (Mon, 05 Aug 2013) Log Message: ----------- another docu link added Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageEvent.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageEvent.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageEvent.java 2013-08-05 12:53:32 UTC (rev 8437) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageEvent.java 2013-08-05 16:38:47 UTC (rev 8438) @@ -22,6 +22,10 @@ * * @see <a href="https://developer.mozilla.org/en/WebSockets/WebSockets_reference/MessageEvent"> * Mozilla documentation</a> + * + * For general information on which properties and functions should be supported, see + * <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#messageevent"> + * Event definitions</a>. * @version $Revision$ * @author Ahmed Ashour */ |
From: <bui...@ca...> - 2013-08-05 14:49:16
|
<html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>CruiseControl Build Result</title> </head> <body> <h1 xmlns:xslt="http://xml.apache.org/xslt">BUILD COMPLETE - build.2368</h1> <table> <tr> <th>Date of build</th><td>08/05/2013 14:55:35</td> </tr> <tr> <th>Time to build</th><td>113 minute(s) 19 second(s)</td> </tr> <tr> <th>Last changed</th><td>08/05/2013 14:53:32</td> </tr> <tr> <th>Last log entry</th><td>oops, test for IE was not correct (mguillem) </td> </tr> </table> <h2>Unit Tests</h2> <p>Test cases: <b>17720</b>, passed: <b>17720</b>, failures: <b>0</b>, errors: <b>0</b>.</p> <table cellpadding="0" cellspacing="0" bgcolor="white" id="utests"> <tr> <td bgcolor="green" width="100%"> </td> </tr> </table> <h2>Modifications</h2> <p>6 modifications since last build.</p> <h3>mguillem: JavaScript: added (simple) support for window.postMessage. Issue 1481 (08/05/2013 11:15:13)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageEvent.java</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/changes/changes.xml</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Event.java</li> </ul> <h3>mguillem: oops, test for IE was not correct (08/05/2013 14:53:32)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java</li> </ul> </body> </html> |
From: <mgu...@us...> - 2013-08-05 12:53:36
|
Revision: 8437 http://sourceforge.net/p/htmlunit/code/8437 Author: mguillem Date: 2013-08-05 12:53:32 +0000 (Mon, 05 Aug 2013) Log Message: ----------- oops, test for IE was not correct Modified Paths: -------------- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2013-08-05 09:15:13 UTC (rev 8436) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2013-08-05 12:53:32 UTC (rev 8437) @@ -1168,7 +1168,7 @@ */ @Test @Alerts(DEFAULT = { "type: message", "data: hello" }, - IE6 = { }, IE7 = { }, IE8 = { }) + IE6 = "exception", IE7 = "exception", IE8 = "exception") public void postMessage() throws Exception { final String html = "<html><body><script>\n" @@ -1176,13 +1176,20 @@ + " alert('type: ' + event.type);\n" + " alert('data: ' + event.data);\n" + "}\n" - + "window.addEventListener('message', receiveMessage, false);\n" + + "if (window.addEventListener) {\n" + + " window.addEventListener('message', receiveMessage, false);\n" + + "}\n" + + "else {\n" + + " window.attachEvent('onmessage', receiveMessage);\n" + + "}\n" + "</script>\n" + "<iframe src='" + URL_SECOND + "'></iframe>\n" + "</body></html>"; final String iframe = "<html><body><script>\n" + + "try {\n" + "top.postMessage('hello', '*');\n" + + "} catch(e) { alert('exception') }\n" + "</script></body></html>"; getMockWebConnection().setResponse(URL_SECOND, iframe); |
From: <bui...@ca...> - 2013-08-05 11:04:16
|
<html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>CruiseControl Build Result</title> </head> <body> <h1 xmlns:xslt="http://xml.apache.org/xslt">BUILD FAILED</h1> <table> <tr> <th>Date of build</th><td>08/05/2013 11:17:13</td> </tr> <tr> <th>Time to build</th><td>106 minute(s) 39 second(s)</td> </tr> <tr> <th>Last changed</th><td>08/05/2013 11:15:13</td> </tr> <tr> <th>Last log entry</th><td>JavaScript: added (simple) support for window.postMessage. Issue 1481 (mguillem) </td> </tr> </table> <h2>Ant Error Message</h2> <pre>Return code is 1</pre> <pre></pre> <h2>Unit Tests</h2> <p>Test cases: <b>17720</b>, passed: <b>17719</b>, failures: <b>0</b>, errors: <b>1</b>.</p> <table cellpadding="0" cellspacing="0" bgcolor="white" id="utests"> <tr> <td bgcolor="green" width="99.99435665914221%"> </td><td bgcolor="#FFFFA0" width="0.0056433408577878106%"> </td> </tr> </table> <h3>Errors</h3> <ul> <li class="oddrow">Window2Test.postMessage [IE8]</li> </ul> <h3>Unit Test Error Details: (1)</h3> <h4>Test: Window2Test.postMessage [IE8]</h4> <p>Type: org.openqa.selenium.WebDriverException</p> <p>Message: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function addEventListener in object [object]. (script in http://localhost:12345/ from (1, 21) to (7, 10)#6) Build info: version: '2.33.0', revision: '4ecaf82108b2a6cc6f006aae81961236eba93358', time: '2013-05-22 12:00:17' System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32.60', java.version: '1.6.0_35' Driver info: driver.version: HtmlUnitDriver</p> <PRE> </PRE> <h2>Modifications</h2> <p>5 modifications since last build.</p> <h3>mguillem: JavaScript: added (simple) support for window.postMessage. Issue 1481 (08/05/2013 11:15:13)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageEvent.java</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/changes/changes.xml</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Event.java</li> </ul> </body> </html> |
From: <mgu...@us...> - 2013-08-05 09:15:16
|
Revision: 8436 http://sourceforge.net/p/htmlunit/code/8436 Author: mguillem Date: 2013-08-05 09:15:13 +0000 (Mon, 05 Aug 2013) Log Message: ----------- JavaScript: added (simple) support for window.postMessage. Issue 1481 Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Event.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageEvent.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2013-08-02 17:43:20 UTC (rev 8435) +++ trunk/htmlunit/src/changes/changes.xml 2013-08-05 09:15:13 UTC (rev 8436) @@ -8,6 +8,9 @@ <body> <release version="2.13" date="???" description="Bugfixes"> + <action type="fix" dev="mguillem" issue="1481"> + JavaScript: added (simple) support for window.postMessage. + </action> <action type="fix" dev="rbri" issue="1532" due-to="Sebastian Cato"> XMLHttpRequest open(..) methods failed when called with null for userid/password. </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Event.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Event.java 2013-08-02 17:43:20 UTC (rev 8435) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Event.java 2013-08-05 09:15:13 UTC (rev 8436) @@ -125,6 +125,9 @@ /** The event type triggered by "onerror" event handlers. */ public static final String TYPE_ERROR = "error"; + /** The message event type, triggered by postMessage. */ + public static final String TYPE_MESSAGE = "message"; + /** The first event phase: the capturing phase. */ @JsxConstant(@WebBrowser(FF)) public static final short CAPTURING_PHASE = 1; Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageEvent.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageEvent.java 2013-08-02 17:43:20 UTC (rev 8435) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageEvent.java 2013-08-05 09:15:13 UTC (rev 8436) @@ -14,7 +14,6 @@ */ package com.gargoylesoftware.htmlunit.javascript.host; -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; @@ -27,7 +26,7 @@ * @author Ahmed Ashour */ @JsxClass -public class MessageEvent extends SimpleScriptable { +public class MessageEvent extends Event { private Object data_; @@ -44,6 +43,7 @@ */ public MessageEvent(final Object data) { data_ = data; + setType(TYPE_MESSAGE); } /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-08-02 17:43:20 UTC (rev 8435) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2013-08-05 09:15:13 UTC (rev 8436) @@ -2038,6 +2038,21 @@ public void setOnchange(final Object onchange) { setHandlerForJavaScript(Event.TYPE_CHANGE, onchange); } + + /** + * Posts a message. + * @param message the object passed to the window + * @param targetOrigin the origin this window must be for the event to be dispatched + * @see <a href="https://developer.mozilla.org/en-US/docs/Web/API/window.postMessage">MDN documentation</a> + */ + @JsxFunction({@WebBrowser(FF), @WebBrowser(CHROME), @WebBrowser(value = IE, minVersion = 9) }) + public void postMessage(final String message, final String targetOrigin) { + final MessageEvent event = new MessageEvent(message); + event.setParentScope(this); + event.setPrototype(getPrototype(event.getClass())); + + dispatchEvent(event); + } } class HTMLCollectionFrames extends HTMLCollection { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2013-08-02 17:43:20 UTC (rev 8435) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2013-08-05 09:15:13 UTC (rev 8436) @@ -1162,4 +1162,30 @@ assertEquals(getExpectedAlerts(), getCollectedAlerts(driver)); } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = { "type: message", "data: hello" }, + IE6 = { }, IE7 = { }, IE8 = { }) + public void postMessage() throws Exception { + final String html + = "<html><body><script>\n" + + "function receiveMessage(event) {\n" + + " alert('type: ' + event.type);\n" + + " alert('data: ' + event.data);\n" + + "}\n" + + "window.addEventListener('message', receiveMessage, false);\n" + + "</script>\n" + + "<iframe src='" + URL_SECOND + "'></iframe>\n" + + "</body></html>"; + + final String iframe = "<html><body><script>\n" + + "top.postMessage('hello', '*');\n" + + "</script></body></html>"; + + getMockWebConnection().setResponse(URL_SECOND, iframe); + loadPageWithAlerts2(html); + } } |
From: <rb...@us...> - 2013-08-02 17:43:23
|
Revision: 8435 http://sourceforge.net/p/htmlunit/code/8435 Author: rbri Date: 2013-08-02 17:43:20 +0000 (Fri, 02 Aug 2013) Log Message: ----------- simplified code Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java 2013-08-02 16:12:07 UTC (rev 8434) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java 2013-08-02 17:43:20 UTC (rev 8435) @@ -501,22 +501,19 @@ } request.setHttpMethod(HttpMethod.valueOf(method.toUpperCase(Locale.ENGLISH))); - if (Undefined.instance != user || Undefined.instance != password) { - String userCred = null; + + // password is ignored if no user defined + final boolean userIsNull = null == user || Undefined.instance == user; + if (!userIsNull) { + final String userCred = user.toString(); + + final boolean passwordIsNull = null == password || Undefined.instance == password; String passwordCred = ""; - final boolean userIsNull = null == user || Undefined.instance == user; - final boolean passwordIsNull = null == password || Undefined.instance == password; - if (!userIsNull) { - userCred = user.toString(); - } if (!passwordIsNull) { passwordCred = password.toString(); } - // password is ignored if no user defined - if (null != userCred) { - request.setCredentials(new UsernamePasswordCredentials(userCred, passwordCred)); - } + request.setCredentials(new UsernamePasswordCredentials(userCred, passwordCred)); } webRequest_ = request; } |
From: <rb...@us...> - 2013-08-02 16:12:10
|
Revision: 8434 http://sourceforge.net/p/htmlunit/code/8434 Author: rbri Date: 2013-08-02 16:12:07 +0000 (Fri, 02 Aug 2013) Log Message: ----------- XMLHttpRequest open(..) methods failed when called with null for userid/password (patch Sebastian Cato) Issue 1532 Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest2Test.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2013-08-02 14:41:06 UTC (rev 8433) +++ trunk/htmlunit/src/changes/changes.xml 2013-08-02 16:12:07 UTC (rev 8434) @@ -8,6 +8,9 @@ <body> <release version="2.13" date="???" description="Bugfixes"> + <action type="fix" dev="rbri" issue="1532" due-to="Sebastian Cato"> + XMLHttpRequest open(..) methods failed when called with null for userid/password. + </action> <action type="fix" dev="rbri" issue="1531" due-to="Sebastian Cato"> XMLHttpRequest open(..) methods delivers wrong credentials. </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java 2013-08-02 14:41:06 UTC (rev 8433) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java 2013-08-02 16:12:07 UTC (rev 8434) @@ -504,10 +504,12 @@ if (Undefined.instance != user || Undefined.instance != password) { String userCred = null; String passwordCred = ""; - if (Undefined.instance != user) { + final boolean userIsNull = null == user || Undefined.instance == user; + final boolean passwordIsNull = null == password || Undefined.instance == password; + if (!userIsNull) { userCred = user.toString(); } - if (Undefined.instance != password) { + if (!passwordIsNull) { passwordCred = password.toString(); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest2Test.java 2013-08-02 14:41:06 UTC (rev 8433) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest2Test.java 2013-08-02 16:12:07 UTC (rev 8434) @@ -671,4 +671,38 @@ loadPageWithAlerts2(html, servlets); } + + /** + * Test XMLHttpRequest with basic authentication. + * @throws Exception on failure + */ + @Test + @Alerts("<xml></xml>") + public void openNullUserIdNullPassword() throws Exception { + final String html = + "<html>\n" + + " <head>\n" + + " <title>XMLHttpRequest Test</title>\n" + + " <script>\n" + + " var request;\n" + + " function testBasicAuth() {\n" + + " if (window.XMLHttpRequest) {\n" + + " request = new XMLHttpRequest();\n" + + " } else if (window.ActiveXObject) {\n" + + " request = new ActiveXObject('Microsoft.XMLHTTP');\n" + + " }\n" + + " request.open('GET', '" + URL_SECOND + "', false, null, null);\n" + + " request.send();\n" + + " alert(request.responseText);\n" + + " }\n" + + " </script>\n" + + " </head>\n" + + " <body onload='testBasicAuth()'>\n" + + " </body>\n" + + "</html>"; + + getMockWebConnection().setResponse(URL_SECOND, "<xml></xml>", "text/xml"); + + loadPageWithAlerts2(html); + } } |
From: <bui...@ca...> - 2013-08-02 16:07:26
|
<html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>CruiseControl Build Result</title> </head> <body> <h1 xmlns:xslt="http://xml.apache.org/xslt">BUILD COMPLETE - build.2365</h1> <table> <tr> <th>Date of build</th><td>08/02/2013 16:35:01</td> </tr> <tr> <th>Time to build</th><td>91 minute(s) 54 second(s)</td> </tr> <tr> <th>Last changed</th><td>08/02/2013 16:33:00</td> </tr> <tr> <th>Last log entry</th><td>fix tests (rbri) </td> </tr> </table> <h2>Unit Tests</h2> <p>Test cases: <b>17714</b>, passed: <b>17714</b>, failures: <b>0</b>, errors: <b>0</b>.</p> <table cellpadding="0" cellspacing="0" bgcolor="white" id="utests"> <tr> <td bgcolor="green" width="100%"> </td> </tr> </table> <h2>Modifications</h2> <p>9 modifications since last build.</p> <h3>rbri: XMLHttpRequest open(..) methods delivers wrong credentials (patch Sebastian Cato) Issue 1531 (08/01/2013 18:14:27)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestTest.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/pom.xml</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/changes/changes.xml</li> </ul> <h3>rbri: try to stop all servers before starting our own (08/01/2013 21:01:33)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java</li> </ul> <h3>rbri: reduce the concurrencyLevel (08/01/2013 22:46:37)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java</li> </ul> <h3>rbri: fix tests (08/02/2013 16:33:00)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest2Test.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java</li> </ul> </body> </html> |
From: <rb...@us...> - 2013-08-02 14:41:08
|
Revision: 8433 http://sourceforge.net/p/htmlunit/code/8433 Author: rbri Date: 2013-08-02 14:41:06 +0000 (Fri, 02 Aug 2013) Log Message: ----------- adjust our initial cache size a bit and implment a limit Issue 1530 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java 2013-08-02 14:33:00 UTC (rev 8432) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java 2013-08-02 14:41:06 UTC (rev 8433) @@ -34,6 +34,7 @@ import java.text.MessageFormat; import java.text.ParseException; import java.util.ArrayList; +import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; @@ -248,10 +249,11 @@ Pattern.compile("(top|bottom|center)\\s*(\\d+\\s*(%|px|cm|mm|in|pt|pc|em|ex)|left|right|center)"); private static final Log LOG = LogFactory.getLog(CSSStyleDeclaration.class); - private static final Map<String, String> CSSColors_ = new ConcurrentHashMap<String, String>(); - private static final Map<String, String> CamelizeCache_ = new ConcurrentHashMap<String, String>(1000, 0.75f, 2); + private static final Map<String, String> CSSColors_ = new HashMap<String, String>(); + private static final Map<String, String> CamelizeCache_ = new ConcurrentHashMap<String, String>(400, 0.75f, 2); private static final Map<String, Integer> PixelValuesCache_ = new ConcurrentHashMap<String, Integer>(1000, 0.75f, 2); + private static final int MaxPixelValuesCacheSize = 20000; /** The different types of shorthand values. */ private enum Shorthand { @@ -4367,6 +4369,10 @@ i = i * 24; } + // refresh in case of overflow + if (PixelValuesCache_.size() > MaxPixelValuesCacheSize) { + PixelValuesCache_.clear(); + } PixelValuesCache_.put(value, Integer.valueOf(i)); return i; } |
From: <rb...@us...> - 2013-08-02 14:33:06
|
Revision: 8432 http://sourceforge.net/p/htmlunit/code/8432 Author: rbri Date: 2013-08-02 14:33:00 +0000 (Fri, 02 Aug 2013) Log Message: ----------- fix tests Modified Paths: -------------- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest2Test.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest2Test.java 2013-08-01 20:46:37 UTC (rev 8431) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest2Test.java 2013-08-02 14:33:00 UTC (rev 8432) @@ -37,6 +37,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; import com.gargoylesoftware.htmlunit.WebRequest; +import com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequestTest.BasicAuthenticationServlet; import com.gargoylesoftware.htmlunit.util.NameValuePair; /** @@ -46,6 +47,7 @@ * @author Marc Guillemot * @author Ahmed Ashour * @author Ronald Brill + * @author Sebastian Cato */ @RunWith(BrowserRunner.class) public class XMLHttpRequest2Test extends WebDriverTestCase { @@ -634,4 +636,39 @@ protected boolean needThreeConnections() { return true; } + + /** + * Test XMLHttpRequest with basic authentication. + * @throws Exception on failure + */ + @Test + @Alerts("Basic:Zm9vOmJhcg==") + public void basicAuthenticationRequest() throws Exception { + final String html = + "<html>\n" + + " <head>\n" + + " <title>XMLHttpRequest Test</title>\n" + + " <script>\n" + + " var request;\n" + + " function testBasicAuth() {\n" + + " if (window.XMLHttpRequest) {\n" + + " request = new XMLHttpRequest();\n" + + " } else if (window.ActiveXObject) {\n" + + " request = new ActiveXObject('Microsoft.XMLHTTP');\n" + + " }\n" + + " request.open('GET', '/protected/token', false, 'foo', 'bar');\n" + + " request.send();\n" + + " alert(request.responseText);\n" + + " }\n" + + " </script>\n" + + " </head>\n" + + " <body onload='testBasicAuth()'>\n" + + " </body>\n" + + "</html>"; + + final Map<String, Class<? extends Servlet>> servlets = new HashMap<String, Class<? extends Servlet>>(); + servlets.put("/protected/token", BasicAuthenticationServlet.class); + + loadPageWithAlerts2(html, servlets); + } } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java 2013-08-01 20:46:37 UTC (rev 8431) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java 2013-08-02 14:33:00 UTC (rev 8432) @@ -42,12 +42,10 @@ import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebResponse; import com.gargoylesoftware.htmlunit.WebServerTestCase; -import com.gargoylesoftware.htmlunit.WebDriverTestCase.MockWebConnectionServlet; import com.gargoylesoftware.htmlunit.html.DomChangeEvent; import com.gargoylesoftware.htmlunit.html.DomChangeListener; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequestTest.BasicAuthenticationServlet; import com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequestTest.StreamingServlet; /** @@ -59,8 +57,6 @@ * @author Ahmed Ashour * @author Stuart Begg * @author Sudhan Moghe - * @author Sebastian Cato - * @author Ronald Brill */ @RunWith(BrowserRunner.class) public class XMLHttpRequest3Test extends WebServerTestCase { @@ -494,44 +490,4 @@ assertEquals(getExpectedAlerts(), collectedAlerts); } - - /** - * Test XMLHttpRequest with basic authentication. - * @throws Exception on failure - */ - @Test - @Alerts("Basic:Zm9vOmJhcg==") - public void basicAuthenticationRequest() throws Exception { - final Map<String, Class<? extends Servlet>> servlets = new HashMap<String, Class<? extends Servlet>>(); - servlets.put("/protected/token", BasicAuthenticationServlet.class); - servlets.put("/*", MockWebConnectionServlet.class); - - stopWebServer(); - startWebServer("./", null, servlets); - - final String html = - "<html>\n" - + " <head>\n" - + " <title>XMLHttpRequest Test</title>\n" - + " <script>\n" - + " var request;\n" - + " function testBasicAuth() {\n" - + " if (window.XMLHttpRequest) {\n" - + " request = new XMLHttpRequest();\n" - + " } else if (window.ActiveXObject) {\n" - + " request = new ActiveXObject('Microsoft.XMLHTTP');\n" - + " }\n" - + " request.open('GET', '/protected/token', false, 'foo', 'bar');\n" - + " request.send();\n" - + " alert(request.responseText);\n" - + " }\n" - + " </script>\n" - + " </head>\n" - + " <body onload='testBasicAuth()'>\n" - + " </body>\n" - + "</html>"; - - loadPageWithAlerts(html, URL_FIRST); - } - } |
From: <bui...@ca...> - 2013-08-01 22:49:43
|
<html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>CruiseControl Build Result</title> </head> <body> <h1 xmlns:xslt="http://xml.apache.org/xslt">BUILD FAILED</h1> <table> <tr> <th>Date of build</th><td>08/01/2013 22:58:14</td> </tr> <tr> <th>Time to build</th><td>111 minute(s) 3 second(s)</td> </tr> <tr> <th>Last changed</th><td>08/01/2013 22:46:37</td> </tr> <tr> <th>Last log entry</th><td>reduce the concurrencyLevel (rbri) </td> </tr> </table> <h2>Ant Error Message</h2> <pre>Return code is 1</pre> <pre></pre> <h2>Unit Tests</h2> <p>Test cases: <b>17714</b>, passed: <b>17710</b>, failures: <b>1</b>, errors: <b>3</b>.</p> <table cellpadding="0" cellspacing="0" bgcolor="white" id="utests"> <tr> <td bgcolor="green" width="99.97741899062888%"> </td><td bgcolor="#FFFFA0" width="0.022581009371118888%"> </td> </tr> </table> <h3>Errors</h3> <ul> <li class="oddrow">XMLHttpRequest3Test.basicAuthenticationRequest [FF3.6]</li> <li class="evenrow">XMLHttpRequest3Test.basicAuthenticationRequest [FF17]</li> <li class="oddrow">XMLHttpRequest3Test.basicAuthenticationRequest [IE8]</li> </ul> <h3>Failures</h3> <ul> <li class="oddrow">addJob_periodicJob2</li> </ul> <h3>Unit Test Error Details: (4)</h3> <h4>Test: XMLHttpRequest3Test.basicAuthenticationRequest [FF3.6]</h4> <p>Type: java.net.BindException</p> <p>Message: Address already in use</p> <PRE> </PRE> <h4>Test: XMLHttpRequest3Test.basicAuthenticationRequest [FF17]</h4> <p>Type: java.net.BindException</p> <p>Message: Address already in use</p> <PRE> </PRE> <h4>Test: XMLHttpRequest3Test.basicAuthenticationRequest [IE8]</h4> <p>Type: java.net.BindException</p> <p>Message: Address already in use</p> <PRE> </PRE> <h4>Test: addJob_periodicJob2</h4> <p>Type: java.lang.AssertionError</p> <p>Message: expected:<2> but was:<0></p> <PRE> </PRE> <h2>Modifications</h2> <p>7 modifications since last build.</p> <h3>rbri: XMLHttpRequest open(..) methods delivers wrong credentials (patch Sebastian Cato) Issue 1531 (08/01/2013 18:14:27)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestTest.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/pom.xml</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/changes/changes.xml</li> </ul> <h3>rbri: try to stop all servers before starting our own (08/01/2013 21:01:33)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java</li> </ul> <h3>rbri: reduce the concurrencyLevel (08/01/2013 22:46:37)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java</li> </ul> </body> </html> |
From: <bui...@ca...> - 2013-08-01 20:53:17
|
<html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>CruiseControl Build Result</title> </head> <body> <h1 xmlns:xslt="http://xml.apache.org/xslt">BUILD FAILED</h1> <table> <tr> <th>Date of build</th><td>08/01/2013 21:04:05</td> </tr> <tr> <th>Time to build</th><td>108 minute(s) 49 second(s)</td> </tr> <tr> <th>Last changed</th><td>08/01/2013 21:01:33</td> </tr> <tr> <th>Last log entry</th><td>try to stop all servers before starting our own (rbri) </td> </tr> </table> <h2>Ant Error Message</h2> <pre>Return code is 1</pre> <pre></pre> <h2>Unit Tests</h2> <p>Test cases: <b>17714</b>, passed: <b>17711</b>, failures: <b>0</b>, errors: <b>3</b>.</p> <table cellpadding="0" cellspacing="0" bgcolor="white" id="utests"> <tr> <td bgcolor="green" width="99.98306424297166%"> </td><td bgcolor="#FFFFA0" width="0.016935757028339167%"> </td> </tr> </table> <h3>Errors</h3> <ul> <li class="oddrow">XMLHttpRequest3Test.basicAuthenticationRequest [FF3.6]</li> <li class="evenrow">XMLHttpRequest3Test.basicAuthenticationRequest [FF17]</li> <li class="oddrow">XMLHttpRequest3Test.basicAuthenticationRequest [IE8]</li> </ul> <h3>Unit Test Error Details: (3)</h3> <h4>Test: XMLHttpRequest3Test.basicAuthenticationRequest [FF3.6]</h4> <p>Type: java.net.BindException</p> <p>Message: Address already in use</p> <PRE> </PRE> <h4>Test: XMLHttpRequest3Test.basicAuthenticationRequest [FF17]</h4> <p>Type: java.net.BindException</p> <p>Message: Address already in use</p> <PRE> </PRE> <h4>Test: XMLHttpRequest3Test.basicAuthenticationRequest [IE8]</h4> <p>Type: java.net.BindException</p> <p>Message: Address already in use</p> <PRE> </PRE> <h2>Modifications</h2> <p>6 modifications since last build.</p> <h3>rbri: XMLHttpRequest open(..) methods delivers wrong credentials (patch Sebastian Cato) Issue 1531 (08/01/2013 18:14:27)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestTest.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/pom.xml</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/changes/changes.xml</li> </ul> <h3>rbri: try to stop all servers before starting our own (08/01/2013 21:01:33)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java</li> </ul> </body> </html> |
From: <rb...@us...> - 2013-08-01 20:46:40
|
Revision: 8431 http://sourceforge.net/p/htmlunit/code/8431 Author: rbri Date: 2013-08-01 20:46:37 +0000 (Thu, 01 Aug 2013) Log Message: ----------- reduce the concurrencyLevel Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java 2013-08-01 19:01:33 UTC (rev 8430) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java 2013-08-01 20:46:37 UTC (rev 8431) @@ -249,8 +249,9 @@ private static final Log LOG = LogFactory.getLog(CSSStyleDeclaration.class); private static final Map<String, String> CSSColors_ = new ConcurrentHashMap<String, String>(); - private static final Map<String, String> CamelizeCache_ = new ConcurrentHashMap<String, String>(1000); - private static final Map<String, Integer> PixelValuesCache_ = new ConcurrentHashMap<String, Integer>(1000); + private static final Map<String, String> CamelizeCache_ = new ConcurrentHashMap<String, String>(1000, 0.75f, 2); + private static final Map<String, Integer> PixelValuesCache_ + = new ConcurrentHashMap<String, Integer>(1000, 0.75f, 2); /** The different types of shorthand values. */ private enum Shorthand { |
From: <rb...@us...> - 2013-08-01 19:01:36
|
Revision: 8430 http://sourceforge.net/p/htmlunit/code/8430 Author: rbri Date: 2013-08-01 19:01:33 +0000 (Thu, 01 Aug 2013) Log Message: ----------- try to stop all servers before starting our own Modified Paths: -------------- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java 2013-08-01 16:14:27 UTC (rev 8429) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java 2013-08-01 19:01:33 UTC (rev 8430) @@ -506,7 +506,8 @@ servlets.put("/protected/token", BasicAuthenticationServlet.class); servlets.put("/*", MockWebConnectionServlet.class); - startWebServer("./src/test/resources/", null, servlets); + stopWebServer(); + startWebServer("./", null, servlets); final String html = "<html>\n" @@ -520,8 +521,7 @@ + " } else if (window.ActiveXObject) {\n" + " request = new ActiveXObject('Microsoft.XMLHTTP');\n" + " }\n" - + " request.open('GET', '/protected/token', " - + " false, 'foo', 'bar');\n" + + " request.open('GET', '/protected/token', false, 'foo', 'bar');\n" + " request.send();\n" + " alert(request.responseText);\n" + " }\n" |
From: <bui...@ca...> - 2013-08-01 17:43:34
|
<html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>CruiseControl Build Result</title> </head> <body> <h1 xmlns:xslt="http://xml.apache.org/xslt">BUILD FAILED</h1> <table> <tr> <th>Date of build</th><td>08/01/2013 18:16:27</td> </tr> <tr> <th>Time to build</th><td>86 minute(s) 49 second(s)</td> </tr> <tr> <th>Last changed</th><td>08/01/2013 18:14:27</td> </tr> <tr> <th>Last log entry</th><td>XMLHttpRequest open(..) methods delivers wrong credentials (patch Sebastian Cato) Issue 1531 (rbri) </td> </tr> </table> <h2>Ant Error Message</h2> <pre>Return code is 1</pre> <pre></pre> <h2>Unit Tests</h2> <p>Test cases: <b>17714</b>, passed: <b>17711</b>, failures: <b>0</b>, errors: <b>3</b>.</p> <table cellpadding="0" cellspacing="0" bgcolor="white" id="utests"> <tr> <td bgcolor="green" width="99.98306424297166%"> </td><td bgcolor="#FFFFA0" width="0.016935757028339167%"> </td> </tr> </table> <h3>Errors</h3> <ul> <li class="oddrow">XMLHttpRequest3Test.basicAuthenticationRequest [FF3.6]</li> <li class="evenrow">XMLHttpRequest3Test.basicAuthenticationRequest [FF17]</li> <li class="oddrow">XMLHttpRequest3Test.basicAuthenticationRequest [IE8]</li> </ul> <h3>Unit Test Error Details: (3)</h3> <h4>Test: XMLHttpRequest3Test.basicAuthenticationRequest [FF3.6]</h4> <p>Type: java.net.BindException</p> <p>Message: Address already in use</p> <PRE> </PRE> <h4>Test: XMLHttpRequest3Test.basicAuthenticationRequest [FF17]</h4> <p>Type: java.net.BindException</p> <p>Message: Address already in use</p> <PRE> </PRE> <h4>Test: XMLHttpRequest3Test.basicAuthenticationRequest [IE8]</h4> <p>Type: java.net.BindException</p> <p>Message: Address already in use</p> <PRE> </PRE> <h2>Modifications</h2> <p>5 modifications since last build.</p> <h3>rbri: XMLHttpRequest open(..) methods delivers wrong credentials (patch Sebastian Cato) Issue 1531 (08/01/2013 18:14:27)</h3> <ul> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestTest.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/pom.xml</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java</li> <li class="evenrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java</li> <li class="oddrow"> <span class="modifificationType">></span> /trunk/htmlunit/src/changes/changes.xml</li> </ul> </body> </html> |
From: <rb...@us...> - 2013-08-01 16:14:35
|
Revision: 8429 http://sourceforge.net/p/htmlunit/code/8429 Author: rbri Date: 2013-08-01 16:14:27 +0000 (Thu, 01 Aug 2013) Log Message: ----------- XMLHttpRequest open(..) methods delivers wrong credentials (patch Sebastian Cato) Issue 1531 Modified Paths: -------------- trunk/htmlunit/pom.xml trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestTest.java Modified: trunk/htmlunit/pom.xml =================================================================== --- trunk/htmlunit/pom.xml 2013-08-01 05:32:31 UTC (rev 8428) +++ trunk/htmlunit/pom.xml 2013-08-01 16:14:27 UTC (rev 8429) @@ -725,6 +725,9 @@ <contributor> <name>Chuck Dumont</name> </contributor> + <contributor> + <name>Sebastian Cato</name> + </contributor> </contributors> <dependencies> <dependency> Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2013-08-01 05:32:31 UTC (rev 8428) +++ trunk/htmlunit/src/changes/changes.xml 2013-08-01 16:14:27 UTC (rev 8429) @@ -8,6 +8,9 @@ <body> <release version="2.13" date="???" description="Bugfixes"> + <action type="fix" dev="rbri" issue="1531" due-to="Sebastian Cato"> + XMLHttpRequest open(..) methods delivers wrong credentials. + </action> <action type="fix" dev="rbri"> attr.baseURI not supported for FF. </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java 2013-08-01 05:32:31 UTC (rev 8428) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java 2013-08-01 16:14:27 UTC (rev 8429) @@ -85,6 +85,7 @@ * @author Ahmed Ashour * @author Stuart Begg * @author Ronald Brill + * @author Sebastian Cato * * @see <a href="http://www.w3.org/TR/XMLHttpRequest/">W3C XMLHttpRequest</a> * @see <a href="http://developer.apple.com/internet/webcontent/xmlhttpreq.html">Safari documentation</a> @@ -507,7 +508,7 @@ userCred = user.toString(); } if (Undefined.instance != password) { - passwordCred = user.toString(); + passwordCred = password.toString(); } // password is ignored if no user defined Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java 2013-08-01 05:32:31 UTC (rev 8428) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest3Test.java 2013-08-01 16:14:27 UTC (rev 8429) @@ -42,10 +42,12 @@ import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebResponse; import com.gargoylesoftware.htmlunit.WebServerTestCase; +import com.gargoylesoftware.htmlunit.WebDriverTestCase.MockWebConnectionServlet; import com.gargoylesoftware.htmlunit.html.DomChangeEvent; import com.gargoylesoftware.htmlunit.html.DomChangeListener; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequestTest.BasicAuthenticationServlet; import com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequestTest.StreamingServlet; /** @@ -57,6 +59,8 @@ * @author Ahmed Ashour * @author Stuart Begg * @author Sudhan Moghe + * @author Sebastian Cato + * @author Ronald Brill */ @RunWith(BrowserRunner.class) public class XMLHttpRequest3Test extends WebServerTestCase { @@ -491,4 +495,43 @@ assertEquals(getExpectedAlerts(), collectedAlerts); } + /** + * Test XMLHttpRequest with basic authentication. + * @throws Exception on failure + */ + @Test + @Alerts("Basic:Zm9vOmJhcg==") + public void basicAuthenticationRequest() throws Exception { + final Map<String, Class<? extends Servlet>> servlets = new HashMap<String, Class<? extends Servlet>>(); + servlets.put("/protected/token", BasicAuthenticationServlet.class); + servlets.put("/*", MockWebConnectionServlet.class); + + startWebServer("./src/test/resources/", null, servlets); + + final String html = + "<html>\n" + + " <head>\n" + + " <title>XMLHttpRequest Test</title>\n" + + " <script>\n" + + " var request;\n" + + " function testBasicAuth() {\n" + + " if (window.XMLHttpRequest) {\n" + + " request = new XMLHttpRequest();\n" + + " } else if (window.ActiveXObject) {\n" + + " request = new ActiveXObject('Microsoft.XMLHTTP');\n" + + " }\n" + + " request.open('GET', '/protected/token', " + + " false, 'foo', 'bar');\n" + + " request.send();\n" + + " alert(request.responseText);\n" + + " }\n" + + " </script>\n" + + " </head>\n" + + " <body onload='testBasicAuth()'>\n" + + " </body>\n" + + "</html>"; + + loadPageWithAlerts(html, URL_FIRST); + } + } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestTest.java 2013-08-01 05:32:31 UTC (rev 8428) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestTest.java 2013-08-01 16:14:27 UTC (rev 8429) @@ -48,6 +48,8 @@ * @author Ahmed Ashour * @author Stuart Begg * @author Sudhan Moghe + * @author Sebastian Cato + * @author Ronald Brill */ @RunWith(BrowserRunner.class) public class XMLHttpRequestTest extends WebDriverTestCase { @@ -732,6 +734,48 @@ } /** + * Servlet for testing XMLHttpRequest basic authentication. + */ + public static final class BasicAuthenticationServlet extends HttpServlet { + + /** + * {@inheritDoc} + */ + @Override + protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws IOException { + handleRequest(req, resp); + } + + /** + * {@inheritDoc} + */ + @Override + protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws IOException { + handleRequest(req, resp); + } + + private void handleRequest(final HttpServletRequest req, final HttpServletResponse resp) throws IOException { + final String authHdr = req.getHeader("Authorization"); + if (null == authHdr) { + resp.setStatus(401); + resp.setHeader("WWW-Authenticate", "Basic realm=\"someRealm\""); + } + else { + final String[] authHdrTokens = authHdr.split("\\s+"); + String authToken = ""; + if (authHdrTokens.length == 2) { + authToken += authHdrTokens[0] + ':' + authHdrTokens[1]; + } + + resp.setStatus(200); + resp.addHeader("Content-Type", "text/plain"); + resp.getOutputStream().print(authToken); + resp.flushBuffer(); + } + } + } + + /** * @throws Exception if the test fails */ @Test |
From: Hamid A. T. <ha...@gm...> - 2013-08-01 09:25:41
|
Hi all, I would like to thank you for developing this great project. Anyway, shouldn't the throw statement in ImmediateRefreshHandler.handleRefresh method, throws an IOException instead of a RuntimeException (as it is suggested in the comments)? Thanks, Hamid |