From: <rb...@us...> - 2014-02-04 16:51:32
|
Revision: 9108 http://sourceforge.net/p/htmlunit/code/9108 Author: rbri Date: 2014-02-04 16:51:29 +0000 (Tue, 04 Feb 2014) Log Message: ----------- test assert fix; window.createPopup is not available in IE11 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Popup.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Popup2Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Popup.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Popup.java 2014-02-04 08:28:49 UTC (rev 9107) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Popup.java 2014-02-04 16:51:29 UTC (rev 9108) @@ -40,9 +40,10 @@ * @author Marc Guillemot * @author David K. Taylor * @author Ahmed Ashour + * @author Ronald Brill * @see <a href="http://msdn.microsoft.com/en-us/library/ms535882.aspx">MSDN documentation</a> */ -@JsxClass(browsers = @WebBrowser(IE)) +@JsxClass(browsers = @WebBrowser(value = IE, maxVersion = 10)) public class Popup extends SimpleScriptable { private boolean opened_; 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 2014-02-04 08:28:49 UTC (rev 9107) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2014-02-04 16:51:29 UTC (rev 9108) @@ -403,7 +403,7 @@ * @see <a href="http://msdn.microsoft.com/en-us/library/ms536392.aspx">MSDN documentation</a> * @return the created popup */ - @JsxFunction(@WebBrowser(IE)) + @JsxFunction(@WebBrowser(value = IE, maxVersion = 10)) public Popup createPopup() { final Popup popup = new Popup(); popup.setParentScope(this); Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Popup2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Popup2Test.java 2014-02-04 08:28:49 UTC (rev 9107) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Popup2Test.java 2014-02-04 16:51:29 UTC (rev 9108) @@ -36,21 +36,21 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", IE = "done") + @Alerts(DEFAULT = "exception", IE8 = "done") public void testPopup() throws Exception { final String html = "<html><head><title>First</title><body>\n" + "<script>\n" - + "try {\n" - + "var oPopup = window.createPopup();\n" - + "var oPopupBody = oPopup.document.body;\n" - + "oPopupBody.innerHTML = 'bla bla';\n" - + "oPopup.show(100, 100, 200, 50, document.body);\n" - + "alert('done');\n" - + "} catch(e) { alert('exception'); }\n" + + " try {\n" + + " var oPopup = window.createPopup();\n" + + " var oPopupBody = oPopup.document.body;\n" + + " oPopupBody.innerHTML = 'bla bla';\n" + + " oPopup.show(100, 100, 200, 50, document.body);\n" + + " alert('done');\n" + + " } catch(e) { alert('exception'); }\n" + "</script>\n" + "</body></html>"; - loadPage2(html); + loadPageWithAlerts2(html); } /** @@ -59,19 +59,19 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", IE = "done") + @Alerts(DEFAULT = "exception", IE8 = "done") public void testPopupBodyStyle() throws Exception { final String html = "<html><head><title>First</title><body>\n" + "<script language='javascript'>\n" - + "try {\n" - + " popup = window.createPopup();\n" - + " popupBody = popup.document.body;\n" - + " popupBody.style.backgroundColor = '#7f7fff';\n" - + " alert('done');\n" - + "} catch(e) { alert('exception'); }\n" + + " try {\n" + + " popup = window.createPopup();\n" + + " popupBody = popup.document.body;\n" + + " popupBody.style.backgroundColor = '#7f7fff';\n" + + " alert('done');\n" + + " } catch(e) { alert('exception'); }\n" + "</script>\n" + "</body></html>"; - loadPage2(html); + loadPageWithAlerts2(html); } } |