[prev in list] [next in list] [prev in thread] [next in thread] 

List:       htmlunit-develop
Subject:    [HtmlUnit] SVN: [12541] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/
From:       asashour () users ! sourceforge ! net
Date:       2016-04-30 0:18:09
Message-ID: E1awIbs-0005aO-QL () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 12541
          http://sourceforge.net/p/htmlunit/code/12541
Author:   asashour
Date:     2016-04-30 00:18:09 +0000 (Sat, 30 Apr 2016)
Log Message:
-----------
more tests

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	2016-04-29 \
                21:41:29 UTC (rev 12540)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java	2016-04-30 \
00:18:09 UTC (rev 12541) @@ -928,12 +928,12 @@
             + "<body onload='test()'>\n"
             + "<script>\n"
             + "  function test() {\n"
-            + "    \n"
+            + " \n"
             + "    Function.prototype.doAlerts = function() {\n"
-            + "      alert(this==o.f);\n"
+            + "      alert(this == o.f);\n"
             + "      alert(this.arguments ? this.arguments.length : 'null');\n"
             + "    }\n"
-            + "    \n"
+            + " \n"
             + "    var o = function() {};\n"
             + "    o.f = function(x, y, z) { this.f.doAlerts(); }\n"
             + "    o.f('a', 'b');\n"
@@ -949,6 +949,72 @@
      * @throws Exception if an error occurs
      */
     @Test
+    @Alerts({"true", "[object Arguments]", "null", "true", "[object Arguments]", \
"[object Arguments]"}) +    public void functionPrototypeArguments2() throws \
Exception { +        final String html =
+              "<html>\n"
+            + "<body onload='test()'>\n"
+            + "<script>\n"
+            + "  function test() {\n"
+            + " \n"
+            + "    Function.prototype.doAlerts = function() {\n"
+            + "      alert(this == o.f);\n"
+            + "      alert(arguments);\n"
+            + "      alert(this.arguments);\n"
+            + "    }\n"
+            + " \n"
+            + "    var o = function() {};\n"
+            + "    o.f = function(x, y, z) {\n"
+            + "      alert(this == o);\n"
+            + "      alert(arguments);\n"
+            + "      alert(this.arguments);\n"
+            + "      this.f.doAlerts();\n"
+            + "    }\n"
+            + "    o.f('a', 'b');\n"
+            + "  }\n"
+            + "</script>\n"
+            + "</body>\n"
+            + "</html>";
+
+        loadPageWithAlerts2(html);
+    }
+
+    /**
+     * @throws Exception if an error occurs
+     */
+    @Test
+    @Alerts({"true", "[object Arguments]", "null", "true", "[object Arguments]", \
"null"}) +    public void functionPrototypeArguments3() throws Exception {
+        final String html =
+              "<html>\n"
+            + "<body onload='test()'>\n"
+            + "<script>\n"
+            + "  function test() {\n"
+            + "    var o = function() {};\n"
+            + "    o.x = function() {\n"
+            + "      alert(this == o);\n"
+            + "      alert(arguments);\n"
+            + "      alert(this.arguments);\n"
+            + "    }\n"
+            + "    o.f = function(x, y, z) {\n"
+            + "      alert(this == o);\n"
+            + "      alert(arguments);\n"
+            + "      alert(this.arguments);\n"
+            + "      this.x();\n"
+            + "    }\n"
+            + "    o.f('a', 'b');\n"
+            + "  }\n"
+            + "</script>\n"
+            + "</body>\n"
+            + "</html>";
+
+        loadPageWithAlerts2(html);
+    }
+
+    /**
+     * @throws Exception if an error occurs
+     */
+    @Test
     @Alerts({"null", "function", "5"})
     public void onError() throws Exception {
         final String html


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
HtmlUnit-develop mailing list
HtmlUnit-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic