[HtmlUnit] SVN: [14632] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ javascript/NativeArrayTest.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] SVN: [14632] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ javascript/NativeArrayTest.java

HtmlUnit - Dev mailing list
Revision: 14632
          http://sourceforge.net/p/htmlunit/code/14632
Author:   rbri
Date:     2017-06-24 14:39:24 +0000 (Sat, 24 Jun 2017)
Log Message:
-----------
test case that shows that rhino's filter is different from the browser

Modified Paths:
--------------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeArrayTest.java

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeArrayTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeArrayTest.java 2017-06-23 19:18:42 UTC (rev 14631)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeArrayTest.java 2017-06-24 14:39:24 UTC (rev 14632)
@@ -353,4 +353,31 @@
 
         loadPageWithAlerts2(html);
     }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = {"1: 20,17", "TypeError"},
+            FF = {"1: 20,17", "2: 20,17"})
+    @NotYetImplemented
+    public void filter() throws Exception {
+        final String html
+            = "<html>\n"
+            + "<head>\n"
+            + "<script>\n"
+            + "  function isBig(n) { return n >= 10; }\n"
+            + "\n"
+            + "  var arr = [1, 20, 7, 17];\n"
+            + "  alert('1: ' + arr.filter(isBig));\n"
+            + "  try {\n"
+            + "    alert('2: ' + Array.filter(arr, isBig));\n"
+            + "  } catch(e) { alert('TypeError'); }\n"
+            + "</script>\n"
+            + "</head>\n"
+            + "<body>\n"
+            + "</body></html>";
+
+        loadPageWithAlerts2(html);
+    }
 }


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop