[HtmlUnit] SVN: [15449] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit

rbri--- via HtmlUnit-develop <[email protected]>
Newsgroups gmane.comp.java.htmlunit.devel
Message-ID <[email protected]>
Revision: 15449
          http://sourceforge.net/p/htmlunit/code/15449
Author:   rbri
Date:     2018-07-10 16:25:01 +0000 (Tue, 10 Jul 2018)
Log Message:
-----------
ff60 support (wip)

Modified Paths:
--------------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrame2Test.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement2Test.java

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrame2Test.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrame2Test.java	2018-07-09 18:01:08 UTC (rev 15448)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrame2Test.java	2018-07-10 16:25:01 UTC (rev 15449)
@@ -28,7 +28,6 @@
 
 import com.gargoylesoftware.htmlunit.BrowserRunner;
 import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts;
-import com.gargoylesoftware.htmlunit.BrowserRunner.BuggyWebDriver;
 import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented;
 import com.gargoylesoftware.htmlunit.MockWebConnection;
 import com.gargoylesoftware.htmlunit.WebDriverTestCase;
@@ -241,9 +240,8 @@
      * @throws Exception if the test fails
      */
     @Test
-    @Alerts(DEFAULT = {"false", "false", "true", "false"},
-            IE = {"false", "false", "false", "false"})
-    @BuggyWebDriver(CHROME)
+    @Alerts(DEFAULT = {"1:true", "2:false", "3:false", "4:false"},
+            IE = {"1:false", "2:false", "3:false", "4:false"})
     @NotYetImplemented({CHROME, FF})
     public void createIframeFromStrictFunction() throws Exception {
         final String html = "<html><head>\n"
@@ -251,13 +249,13 @@
                 + "  function test() {\n"
                 + "    'use strict';\n"
                 + "    var iframe = document.createElement('iframe');\n"
-                + "    alert(!this);\n"
-                + "    alert(!iframe);\n"
+                + "    alert('1:' + !this);\n"
+                + "    alert('2:' + !iframe);\n"
                 + "  }\n"
                 + "  function test2() {\n"
                 + "    var iframe = document.createElement('iframe');\n"
-                + "    alert(!this);\n"
-                + "    alert(!iframe);\n"
+                + "    alert('3:' + !this);\n"
+                + "    alert('4:' + !iframe);\n"
                 + "  }\n"
                 + "</script>\n"
                 + "</head>\n"

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement2Test.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement2Test.java	2018-07-09 18:01:08 UTC (rev 15448)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement2Test.java	2018-07-10 16:25:01 UTC (rev 15449)
@@ -1183,21 +1183,28 @@
             + "<head>\n"
             + "  <title>test</title>\n"
             + "  <script>\n"
+            + "  function log(x) {\n"
+            + "    document.getElementById('log').value += x + '\\n';\n"
+            + "  }\n"
             + "  function doTest() {\n"
             + "    var myNode = document.getElementById('myNode');\n"
-            + "    alert('Old = ' + myNode.innerHTML);\n"
+            + "    log('Old = ' + myNode.innerHTML);\n"
             + "    myNode.innerHTML = ' <b><i id=\"newElt\">New cell value</i></b>';\n"
-            + "    alert('New = ' + myNode.innerHTML);\n"
-            + "    alert(document.getElementById('newElt').tagName);\n"
+            + "    log('New = ' + myNode.innerHTML);\n"
+            + "    log(document.getElementById('newElt').tagName);\n"
             + "  }\n"
             + "  </script>\n"
             + "</head>\n"
             + "<body onload='doTest()'>\n"
-            + "<p id='myNode'><b>Old innerHTML</b><!-- old comment --></p>\n"
+            + "  <p id='myNode'><b>Old innerHTML</b><!-- old comment --></p>\n"
+            + "  <textarea id='log'></textarea>\n"
             + "</body>\n"
             + "</html>";
 
-        final WebDriver driver = loadPageWithAlerts2(html);
+        final WebDriver driver = loadPage2(html);
+        final WebElement log = driver.findElement(By.id("log"));
+        final String text = log.getAttribute("value").trim().replaceAll("\r", "");
+        assertEquals(String.join("\n", getExpectedAlerts()), text);
 
         final WebElement pElt = driver.findElement(By.id("myNode"));
         assertEquals("p", pElt.getTagName());


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.