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

List:       htmlunit-develop
Subject:    [HtmlUnit] SVN: [9655] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/
From:       asashour () users ! sourceforge ! net
Date:       2014-08-26 7:38:48
Message-ID: E1XMBL9-0004cY-IB () sfs-ml-2 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 9655
          http://sourceforge.net/p/htmlunit/code/9655
Author:   asashour
Date:     2014-08-26 07:38:45 +0000 (Tue, 26 Aug 2014)
Log Message:
-----------
StorateTest: add test cases as @NYI
Issue 1639

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


Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/StorageTest.java
 ===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/StorageTest.java	2014-08-25 \
                15:52:56 UTC (rev 9654)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/StorageTest.java	2014-08-26 \
07:38:45 UTC (rev 9655) @@ -37,6 +37,7 @@
  * @author Ahmed Ashour
  * @author Marc Guillemot
  * @author Frank Danek
+ * @author Jake Cobb
  */
 @RunWith(BrowserRunner.class)
 public class StorageTest extends WebDriverTestCase {
@@ -200,4 +201,72 @@
             }
         }
     }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts({ "undefined", "null", "extraMethod called", "null" })
+    @NotYetImplemented
+    public void prototypeIsExtensible() throws Exception {
+        final String html = "<html><body><script>\n"
+            + "try {\n"
+            + "  localStorage.clear();\n"
+            + "  alert(localStorage.extraMethod);\n"
+            + "  alert(localStorage.getItem('extraMethod'));\n"
+            + "  Storage.prototype.extraMethod = function() {\n"
+            + "    alert('extraMethod called');\n"
+            + "  };\n"
+            + "  try {\n"
+            + "    localStorage.extraMethod();\n"
+            + "  } catch (e2) {\n"
+            + "    alert('localStorage.extraMethod not callable');\n"
+            + "  }\n"
+            + "  alert(localStorage.getItem('extraMethod'));\n"
+            + "} catch (e) { alert('exception'); }\n"
+            + "</script></body></html>";
+        loadPageWithAlerts2(html);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = { "function", "null", "function", "value" },
+            IE = { "function", "null", "string", "value" })
+    @NotYetImplemented
+    public void prototypePropertiesAreVisible() throws Exception {
+        final String html = "<html><body><script>\n"
+            + "try {\n"
+            + "  localStorage.clear();\n"
+            + "  alert(typeof localStorage.hasOwnProperty);\n"
+            + "  alert(localStorage.getItem('hasOwnProperty'));\n"
+            + "  localStorage.setItem('hasOwnProperty', 'value');\n"
+            + "  alert(typeof localStorage.hasOwnProperty);\n"
+            + "  alert(localStorage.getItem('hasOwnProperty'));\n"
+            + "} catch (e) { alert('exception'); }\n"
+            + "</script></body></html>";
+        loadPageWithAlerts2(html);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = { "function", "null", "string", "value" },
+            CHROME = { "function", "null", "string", "null" })
+    @NotYetImplemented
+    public void writeToPrototypeProperty() throws Exception {
+        final String html = "<html><body><script>\n"
+            + "try {\n"
+            + "  localStorage.clear();\n"
+            + "  alert(typeof localStorage.hasOwnProperty);\n"
+            + "  alert(localStorage.getItem('hasOwnProperty'));\n"
+            + "  localStorage.hasOwnProperty = 'value';\n"
+            + "  alert(typeof localStorage.hasOwnProperty);\n"
+            + "  alert(localStorage.getItem('hasOwnProperty'));\n"
+            + "} catch (e) { alert('exception'); }\n"
+            + "</script></body></html>";
+        loadPageWithAlerts2(html);
+    }
 }


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
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