diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger')
19 files changed, 730 insertions, 0 deletions
diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/storage_builtins.js b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/storage_builtins.js new file mode 100644 index 000000000..9c2f1a5ff --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/storage_builtins.js @@ -0,0 +1,15 @@ +function test_storage_builtins(aStorage) { + test(function() { + aStorage.clear(); + assert_equals(aStorage.length, 0, "aStorage.length"); + + var builtins = ["key", "getItem", "setItem", "removeItem", "clear"]; + var origBuiltins = builtins.map(function(b) { return Storage.prototype[b]; }); + assert_array_equals(builtins.map(function(b) { return aStorage[b]; }), origBuiltins, "a"); + builtins.forEach(function(b) { aStorage[b] = b; }); + assert_array_equals(builtins.map(function(b) { return aStorage[b]; }), origBuiltins, "b"); + assert_array_equals(builtins.map(function(b) { return aStorage.getItem(b); }), builtins, "c"); + + assert_equals(aStorage.length, builtins.length, "aStorage.length"); + }); +} diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_event_constructor_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_event_constructor_js.html new file mode 100644 index 000000000..3bfca4b13 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_event_constructor_js.html @@ -0,0 +1,37 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>event_Constructor</h1> + <div id="log"></div> + <script> + test(function() { + var t = async_test("StorageEvent constructor and nulls"); + function onStorageEvent(event) { + t.step(function() { + assert_equals(event.type, 'storage', 'type'); + assert_equals(event.key, null, 'key'); + assert_equals(event.oldValue, null, 'oldValue'); + assert_equals(event.newValue, null, 'newValue'); + assert_equals(event.url, 'null', 'url'); + assert_equals(event.storageArea, null, 'storageArea'); + }); + t.done(); + } + + window.addEventListener('storage', onStorageEvent, false); + var event = new StorageEvent('storage', { + key: null, + oldValue: null, + newValue: null, + url: null + }); + window.dispatchEvent(event); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_missing_arguments.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_missing_arguments.html new file mode 100644 index 000000000..984c60a12 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_missing_arguments.html @@ -0,0 +1,32 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>missing_arguments</h1> + <div id="log"></div> + <script> + var tests = [ + function() { localStorage.key(); }, + function() { localStorage.getItem(); }, + function() { localStorage.setItem(); }, + function() { localStorage.setItem("a"); }, + function() { localStorage.removeItem(); }, + function() { sessionStorage.key(); }, + function() { sessionStorage.getItem(); }, + function() { sessionStorage.setItem(); }, + function() { sessionStorage.setItem("a"); }, + function() { sessionStorage.removeItem(); }, + function() { new StorageEvent(); } + ]; + tests.forEach(function(fun) { + test(function() { + assert_throws(new TypeError(), fun); + }, "Should throw TypeError for " + format_value(fun) + "."); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_builtins.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_builtins.html new file mode 100644 index 000000000..204c9bd77 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_builtins.html @@ -0,0 +1,16 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="storage_builtins.js"></script> + </head> + <body> + <h1>storage_local_builtins</h1> + <div id="log"></div> + <script> + test_storage_builtins(localStorage); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_clear_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_clear_js.html new file mode 100644 index 000000000..84b4bd087 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_clear_js.html @@ -0,0 +1,25 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_local_clear</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + localStorage.setItem("name", "user1"); + + assert_not_equals(localStorage.name, undefined); + assert_equals(localStorage.length, 1); + + localStorage.clear(); + assert_equals(localStorage.name, undefined, "localStorage.name") + assert_equals(localStorage.length, 0, "localStorage.length") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_getitem_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_getitem_js.html new file mode 100644 index 000000000..ecced7ff2 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_getitem_js.html @@ -0,0 +1,38 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_local_getItem</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + localStorage.setItem("undefined", "foo"); + localStorage.setItem("null", "bar"); + localStorage.setItem("", "baz"); + test(function() { + assert_equals(localStorage.length, 3); + }, "All 3 items should be added."); + test(function() { + assert_equals(localStorage["unknown"], undefined, "localStorage['unknown']") + assert_equals(localStorage["undefined"], "foo", "localStorage['undefined']") + assert_equals(localStorage["null"], "bar", "localStorage['null']") + assert_equals(localStorage[undefined], "foo", "localStorage[undefined]") + assert_equals(localStorage[null], "bar", "localStorage[null]") + assert_equals(localStorage[""], "baz", "localStorage['']") + }, "array access should be correct"); + test(function() { + assert_equals(localStorage.getItem("undefined"), "foo", "localStorage.getItem('undefined')") + assert_equals(localStorage.getItem("null"), "bar", "localStorage.getItem('null')") + assert_equals(localStorage.getItem(undefined), "foo", "localStorage.getItem(undefined)") + assert_equals(localStorage.getItem(null), "bar", "localStorage.getItem(null)") + assert_equals(localStorage.getItem(""), "baz", "localStorage.getItem('')") + }, "getItem should be correct") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_in_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_in_js.html new file mode 100644 index 000000000..b3f35cd9d --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_in_js.html @@ -0,0 +1,29 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_local_in</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + assert_false("name" in localStorage); + localStorage["name"] = "user1"; + assert_true("name" in localStorage); + }); + test(function() { + localStorage.clear(); + assert_false("name" in localStorage); + localStorage.setItem("name", "user1"); + assert_true("name" in localStorage); + assert_equals(localStorage.name, "user1"); + localStorage.removeItem("name"); + assert_false("name" in localStorage); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_index_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_index_js.html new file mode 100644 index 000000000..71dabace1 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_index_js.html @@ -0,0 +1,36 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_local_index</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + localStorage["name"] = "user1"; + localStorage["age"] = "42"; + test(function() { + assert_equals(localStorage[-1], undefined); + assert_equals(localStorage[0], undefined); + assert_equals(localStorage[1], undefined); + assert_equals(localStorage[2], undefined); + }) + test(function() { + assert_equals(localStorage["-1"], undefined); + assert_equals(localStorage["0"], undefined); + assert_equals(localStorage["1"], undefined); + assert_equals(localStorage["2"], undefined); + }) + localStorage.setItem(1, "number"); + test(function() { + assert_equals(localStorage[1], "number"); + assert_equals(localStorage["1"], "number"); + }) + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_length_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_length_js.html new file mode 100644 index 000000000..445db5189 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_length_js.html @@ -0,0 +1,23 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_local_length</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + assert_equals(localStorage.length, 0, "localStorage.length") + + localStorage["name"] = "user1"; + localStorage["age"] = "20"; + + assert_equals(localStorage.length, 2, "localStorage.length") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_removeitem_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_removeitem_js.html new file mode 100644 index 000000000..a8f10e80a --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_removeitem_js.html @@ -0,0 +1,37 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_local_removeItem</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + localStorage.setItem("name", "user1"); + assert_equals(localStorage.getItem("name"), "user1"); + + test(function() { + delete localStorage["name"]; + delete localStorage["unknown"]; + assert_equals(localStorage.getItem("name"), null, "localStorage.getItem('name')") + }); + test(function() { + localStorage.setItem("null", "test"); + assert_true("null" in localStorage); + localStorage.removeItem(null, "test"); + assert_false("null" in localStorage); + }); + test(function() { + localStorage.setItem("undefined", "test"); + assert_true("undefined" in localStorage); + localStorage.removeItem(undefined, "test"); + assert_false("undefined" in localStorage); + }); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_setitem_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_setitem_js.html new file mode 100644 index 000000000..9549fa52f --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_setitem_js.html @@ -0,0 +1,119 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_local_setItem</h1> + <div id="log"></div> + <script> + var test_error = { name: "test" }; + test(function() { + localStorage.clear(); + test(function() { + assert_false("name" in localStorage); + assert_false("age" in localStorage); + }); + test(function() { + localStorage["name"] = "user1"; + assert_true("name" in localStorage); + assert_equals(localStorage.length, 1, "localStorage.length") + assert_equals(localStorage.getItem("name"), "user1"); + assert_equals(localStorage["name"], "user1"); + }); + test(function() { + localStorage["name"] = "user2"; + assert_true("name" in localStorage); + assert_equals(localStorage.length, 1, "localStorage.length") + assert_equals(localStorage.getItem("name"), "user2"); + assert_equals(localStorage["name"], "user2"); + }); + test(function() { + localStorage.setItem("name", "user3"); + assert_true("name" in localStorage); + assert_equals(localStorage.length, 1, "localStorage.length") + assert_equals(localStorage.getItem("name"), "user3"); + assert_equals(localStorage["name"], "user3"); + }); + test(function() { + localStorage.setItem("age", null); + assert_true("age" in localStorage); + assert_equals(localStorage.length, 2, "localStorage.length") + assert_equals(localStorage.getItem("age"), "null"); + assert_equals(localStorage["age"], "null"); + }); + test(function() { + localStorage["age"] = null; + assert_true("age" in localStorage); + assert_equals(localStorage.length, 2, "localStorage.length") + assert_equals(localStorage.getItem("age"), "null"); + assert_equals(localStorage["age"], "null"); + }); + test(function() { + localStorage.setItem("age", undefined); + assert_true("age" in localStorage); + assert_equals(localStorage.length, 2, "localStorage.length") + assert_equals(localStorage.getItem("age"), "undefined"); + assert_equals(localStorage["age"], "undefined"); + }); + test(function() { + localStorage["age"] = undefined; + assert_true("age" in localStorage); + assert_equals(localStorage.length, 2, "localStorage.length") + assert_equals(localStorage.getItem("age"), "undefined"); + assert_equals(localStorage["age"], "undefined"); + }); + test(function() { + assert_throws(test_error, function() { + localStorage.setItem("age", + { toString: function() { throw test_error; } }); + }); + assert_true("age" in localStorage); + assert_equals(localStorage.length, 2, "localStorage.length") + assert_equals(localStorage.getItem("age"), "undefined"); + assert_equals(localStorage["age"], "undefined"); + }); + test(function() { + assert_throws(test_error, function() { + localStorage["age"] = + { toString: function() { throw test_error; } }; + }); + assert_true("age" in localStorage); + assert_equals(localStorage.length, 2, "localStorage.length") + assert_equals(localStorage.getItem("age"), "undefined"); + assert_equals(localStorage["age"], "undefined"); + }); + test(function() { + localStorage.setItem(undefined, "test"); + assert_true("undefined" in localStorage); + assert_equals(localStorage.length, 3, "localStorage.length") + assert_equals(localStorage.getItem("undefined"), "test"); + assert_equals(localStorage["undefined"], "test"); + }); + test(function() { + localStorage[undefined] = "test2"; + assert_true("undefined" in localStorage); + assert_equals(localStorage.length, 3, "localStorage.length") + assert_equals(localStorage.getItem("undefined"), "test2"); + assert_equals(localStorage["undefined"], "test2"); + }); + test(function() { + localStorage.setItem(null, "test"); + assert_true("null" in localStorage); + assert_equals(localStorage.length, 4, "localStorage.length") + assert_equals(localStorage.getItem("null"), "test"); + assert_equals(localStorage["null"], "test"); + }); + test(function() { + localStorage[null] = "test2"; + assert_true("null" in localStorage); + assert_equals(localStorage.length, 4, "localStorage.length") + assert_equals(localStorage.getItem("null"), "test2"); + assert_equals(localStorage["null"], "test2"); + }); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_builtins.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_builtins.html new file mode 100644 index 000000000..ad9ae642d --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_builtins.html @@ -0,0 +1,16 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="storage_builtins.js"></script> + </head> + <body> + <h1>storage_session_builtins</h1> + <div id="log"></div> + <script> + test_storage_builtins(sessionStorage); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_clear_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_clear_js.html new file mode 100644 index 000000000..a6805f7a8 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_clear_js.html @@ -0,0 +1,25 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_session_clear</h1> + <div id="log"></div> + <script> + test(function() { + sessionStorage.clear(); + sessionStorage.setItem("name", "user1"); + + assert_not_equals(sessionStorage.name, undefined); + assert_equals(sessionStorage.length, 1); + + sessionStorage.clear(); + assert_equals(sessionStorage.name, undefined, "sessionStorage.name") + assert_equals(sessionStorage.length, 0, "sessionStorage.length") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_getitem_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_getitem_js.html new file mode 100644 index 000000000..bc37c47e9 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_getitem_js.html @@ -0,0 +1,38 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_session_getItem</h1> + <div id="log"></div> + <script> + test(function() { + sessionStorage.clear(); + sessionStorage.setItem("undefined", "foo"); + sessionStorage.setItem("null", "bar"); + sessionStorage.setItem("", "baz"); + test(function() { + assert_equals(sessionStorage.length, 3); + }, "All 3 items should be added."); + test(function() { + assert_equals(sessionStorage["unknown"], undefined, "sessionStorage['unknown']") + assert_equals(sessionStorage["undefined"], "foo", "sessionStorage['undefined']") + assert_equals(sessionStorage["null"], "bar", "sessionStorage['null']") + assert_equals(sessionStorage[undefined], "foo", "sessionStorage[undefined]") + assert_equals(sessionStorage[null], "bar", "sessionStorage[null]") + assert_equals(sessionStorage[""], "baz", "sessionStorage['']") + }, "array access should be correct"); + test(function() { + assert_equals(sessionStorage.getItem("undefined"), "foo", "sessionStorage.getItem('undefined')") + assert_equals(sessionStorage.getItem("null"), "bar", "sessionStorage.getItem('null')") + assert_equals(sessionStorage.getItem(undefined), "foo", "sessionStorage.getItem(undefined)") + assert_equals(sessionStorage.getItem(null), "bar", "sessionStorage.getItem(null)") + assert_equals(sessionStorage.getItem(""), "baz", "sessionStorage.getItem('')") + }, "getItem should be correct") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_in_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_in_js.html new file mode 100644 index 000000000..a285357d2 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_in_js.html @@ -0,0 +1,29 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_session_in</h1> + <div id="log"></div> + <script> + test(function() { + sessionStorage.clear(); + assert_false("name" in sessionStorage); + sessionStorage["name"] = "user1"; + assert_true("name" in sessionStorage); + }); + test(function() { + sessionStorage.clear(); + assert_false("name" in sessionStorage); + sessionStorage.setItem("name", "user1"); + assert_true("name" in sessionStorage); + assert_equals(sessionStorage.name, "user1"); + sessionStorage.removeItem("name"); + assert_false("name" in sessionStorage); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_index_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_index_js.html new file mode 100644 index 000000000..1aec8715a --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_index_js.html @@ -0,0 +1,36 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_session_index</h1> + <div id="log"></div> + <script> + test(function() { + sessionStorage.clear(); + sessionStorage["name"] = "user1"; + sessionStorage["age"] = "42"; + test(function() { + assert_equals(sessionStorage[-1], undefined); + assert_equals(sessionStorage[0], undefined); + assert_equals(sessionStorage[1], undefined); + assert_equals(sessionStorage[2], undefined); + }) + test(function() { + assert_equals(sessionStorage["-1"], undefined); + assert_equals(sessionStorage["0"], undefined); + assert_equals(sessionStorage["1"], undefined); + assert_equals(sessionStorage["2"], undefined); + }) + sessionStorage.setItem(1, "number"); + test(function() { + assert_equals(sessionStorage[1], "number"); + assert_equals(sessionStorage["1"], "number"); + }) + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_length_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_length_js.html new file mode 100644 index 000000000..50e05a26d --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_length_js.html @@ -0,0 +1,23 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_session_length</h1> + <div id="log"></div> + <script> + test(function() { + sessionStorage.clear(); + assert_equals(sessionStorage.length, 0, "sessionStorage.length") + + sessionStorage["name"] = "user1"; + sessionStorage["age"] = "20"; + + assert_equals(sessionStorage.length, 2, "sessionStorage.length") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_removeitem_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_removeitem_js.html new file mode 100644 index 000000000..5012cffb7 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_removeitem_js.html @@ -0,0 +1,37 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_session_removeItem</h1> + <div id="log"></div> + <script> + test(function() { + sessionStorage.clear(); + sessionStorage.setItem("name", "user1"); + assert_equals(sessionStorage.getItem("name"), "user1"); + + test(function() { + delete sessionStorage["name"]; + delete sessionStorage["unknown"]; + assert_equals(sessionStorage.getItem("name"), null, "sessionStorage.getItem('name')") + }); + test(function() { + sessionStorage.setItem("null", "test"); + assert_true("null" in sessionStorage); + sessionStorage.removeItem(null, "test"); + assert_false("null" in sessionStorage); + }); + test(function() { + sessionStorage.setItem("undefined", "test"); + assert_true("undefined" in sessionStorage); + sessionStorage.removeItem(undefined, "test"); + assert_false("undefined" in sessionStorage); + }); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_setitem_js.html b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_setitem_js.html new file mode 100644 index 000000000..8f2339c5f --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_setitem_js.html @@ -0,0 +1,119 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>storage_session_setItem</h1> + <div id="log"></div> + <script> + var test_error = { name: "test" }; + test(function() { + sessionStorage.clear(); + test(function() { + assert_false("name" in sessionStorage); + assert_false("age" in sessionStorage); + }); + test(function() { + sessionStorage["name"] = "user1"; + assert_true("name" in sessionStorage); + assert_equals(sessionStorage.length, 1, "sessionStorage.length") + assert_equals(sessionStorage.getItem("name"), "user1"); + assert_equals(sessionStorage["name"], "user1"); + }); + test(function() { + sessionStorage["name"] = "user2"; + assert_true("name" in sessionStorage); + assert_equals(sessionStorage.length, 1, "sessionStorage.length") + assert_equals(sessionStorage.getItem("name"), "user2"); + assert_equals(sessionStorage["name"], "user2"); + }); + test(function() { + sessionStorage.setItem("name", "user3"); + assert_true("name" in sessionStorage); + assert_equals(sessionStorage.length, 1, "sessionStorage.length") + assert_equals(sessionStorage.getItem("name"), "user3"); + assert_equals(sessionStorage["name"], "user3"); + }); + test(function() { + sessionStorage.setItem("age", null); + assert_true("age" in sessionStorage); + assert_equals(sessionStorage.length, 2, "sessionStorage.length") + assert_equals(sessionStorage.getItem("age"), "null"); + assert_equals(sessionStorage["age"], "null"); + }); + test(function() { + sessionStorage["age"] = null; + assert_true("age" in sessionStorage); + assert_equals(sessionStorage.length, 2, "sessionStorage.length") + assert_equals(sessionStorage.getItem("age"), "null"); + assert_equals(sessionStorage["age"], "null"); + }); + test(function() { + sessionStorage.setItem("age", undefined); + assert_true("age" in sessionStorage); + assert_equals(sessionStorage.length, 2, "sessionStorage.length") + assert_equals(sessionStorage.getItem("age"), "undefined"); + assert_equals(sessionStorage["age"], "undefined"); + }); + test(function() { + sessionStorage["age"] = undefined; + assert_true("age" in sessionStorage); + assert_equals(sessionStorage.length, 2, "sessionStorage.length") + assert_equals(sessionStorage.getItem("age"), "undefined"); + assert_equals(sessionStorage["age"], "undefined"); + }); + test(function() { + assert_throws(test_error, function() { + sessionStorage.setItem("age", + { toString: function() { throw test_error; } }); + }); + assert_true("age" in sessionStorage); + assert_equals(sessionStorage.length, 2, "sessionStorage.length") + assert_equals(sessionStorage.getItem("age"), "undefined"); + assert_equals(sessionStorage["age"], "undefined"); + }); + test(function() { + assert_throws(test_error, function() { + sessionStorage["age"] = + { toString: function() { throw test_error; } }; + }); + assert_true("age" in sessionStorage); + assert_equals(sessionStorage.length, 2, "sessionStorage.length") + assert_equals(sessionStorage.getItem("age"), "undefined"); + assert_equals(sessionStorage["age"], "undefined"); + }); + test(function() { + sessionStorage.setItem(undefined, "test"); + assert_true("undefined" in sessionStorage); + assert_equals(sessionStorage.length, 3, "sessionStorage.length") + assert_equals(sessionStorage.getItem("undefined"), "test"); + assert_equals(sessionStorage["undefined"], "test"); + }); + test(function() { + sessionStorage[undefined] = "test2"; + assert_true("undefined" in sessionStorage); + assert_equals(sessionStorage.length, 3, "sessionStorage.length") + assert_equals(sessionStorage.getItem("undefined"), "test2"); + assert_equals(sessionStorage["undefined"], "test2"); + }); + test(function() { + sessionStorage.setItem(null, "test"); + assert_true("null" in sessionStorage); + assert_equals(sessionStorage.length, 4, "sessionStorage.length") + assert_equals(sessionStorage.getItem("null"), "test"); + assert_equals(sessionStorage["null"], "test"); + }); + test(function() { + sessionStorage[null] = "test2"; + assert_true("null" in sessionStorage); + assert_equals(sessionStorage.length, 4, "sessionStorage.length") + assert_equals(sessionStorage.getItem("null"), "test2"); + assert_equals(sessionStorage["null"], "test2"); + }); + }); + </script> + </body> +</html> |