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 | |
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')
56 files changed, 1946 insertions, 0 deletions
diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_change_item_iframe.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_change_item_iframe.html new file mode 100644 index 000000000..19505615d --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_change_item_iframe.html @@ -0,0 +1,18 @@ +<!DOCTYPE HTML> +<html> + <body> + <script> + if (('localStorage' in window) && window.localStorage !== null){ + try { + localStorage.setItem("name", "user1"); + localStorage.setItem("name", "user2"); + } catch (e) { + parent.fail("setItem method is failed."); + } + localStorage.clear(); + } else { + parent.fail("localStorage is not supported."); + } + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_security_iframe.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_security_iframe.html new file mode 100644 index 000000000..bc2fad3ab --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_security_iframe.html @@ -0,0 +1,16 @@ +<!DOCTYPE HTML>
+<html>
+ <body>
+ <script>
+ if (('localStorage' in window) && window.localStorage != null){
+ try {
+ localStorage.setItem("Security", "false");
+ parent.localStorage.clear();
+ } catch (e) {
+ if(e.code == e['SECURITY_ERR'])
+ localStorage.setItem("Security", "true");
+ }
+ }
+ </script>
+ </body>
+</html>
diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_set_item_clear_iframe.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_set_item_clear_iframe.html new file mode 100644 index 000000000..74a6285a2 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_set_item_clear_iframe.html @@ -0,0 +1,17 @@ +<!DOCTYPE HTML> +<html> + <body> + <script> + if (('localStorage' in window) && window.localStorage !== null){ + try { + localStorage.setItem("name", "user1"); + } catch (e) { + parent.fail("setItem method is failed."); + } + localStorage.clear(); + } else { + parent.fail("localStorage is not supported."); + } + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_set_item_iframe.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_set_item_iframe.html new file mode 100644 index 000000000..bacb3b2bb --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_set_item_iframe.html @@ -0,0 +1,16 @@ +<!DOCTYPE HTML> +<html> + <body> + <script> + if (('localStorage' in window) && window.localStorage !== null){ + try { + localStorage.setItem("name", "user1"); + } catch (e) { + parent.fail("setItem method is failed."); + } + } else { + parent.fail("localStorage is not supported."); + } + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_change_item_iframe.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_change_item_iframe.html new file mode 100644 index 000000000..6c86f58ed --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_change_item_iframe.html @@ -0,0 +1,18 @@ +<!DOCTYPE HTML> +<html> + <body> + <script> + if (('sessionStorage' in window) && window.sessionStorage !== null){ + try { + sessionStorage.setItem("name", "user1"); + sessionStorage.setItem("name", "user2"); + } catch (e) { + parent.fail("setItem method is failed."); + } + sessionStorage.clear(); + } else { + parent.fail("sessionStorage is not supported."); + } + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_set_item_clear_iframe.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_set_item_clear_iframe.html new file mode 100644 index 000000000..a305f21a9 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_set_item_clear_iframe.html @@ -0,0 +1,17 @@ +<!DOCTYPE HTML> +<html> + <body> + <script> + if (('sessionStorage' in window) && window.sessionStorage !== null){ + try { + sessionStorage.setItem('name', 'user1'); + } catch (e) { + parent.fail('setItem method is failed.'); + } + sessionStorage.clear(); + } else { + parent.fail('sessionStorage is not supported.'); + } + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_set_item_iframe.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_set_item_iframe.html new file mode 100644 index 000000000..28d7059c3 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_set_item_iframe.html @@ -0,0 +1,16 @@ +<!DOCTYPE HTML> +<html> + <body> + <script> + if (('sessionStorage' in window) && window.sessionStorage !== null){ + try { + sessionStorage.setItem('name', 'user1'); + } catch (e) { + parent.fail('setItem method is failed.'); + } + } else { + parent.fail('sessionStorage is not supported.'); + } + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_constructor.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_constructor.html new file mode 100644 index 000000000..cc543c7fc --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_constructor.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>event_session_Constructor</h1> + <div id="log"></div> + <script> + test(function() { + var t = async_test("storageeventinit test"); + function onStorageEvent(event) { + t.step(function() { + assert_equals(event.type, 'storage'); + assert_equals(event.key, null); + assert_equals(event.oldValue, null); + assert_equals(event.newValue, null); + assert_equals(event.url, ''); + assert_equals(event.storageArea, null); + }); + t.done(); + } + + window.addEventListener('storage', onStorageEvent, false); + var event = new StorageEvent('storage'); + window.dispatchEvent(event); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_key.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_key.html new file mode 100644 index 000000000..534f92f3b --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_key.html @@ -0,0 +1,42 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + function fail(msg) { + t.step(function() { + assert_notreached(msg); + }); + t.done(); + } + </script> + </head> + <body> + <h1>event_local_key</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + var t = async_test("key property test of local event"); + var expected = ['name', null] + function onStorageEvent(event) { + t.step(function() { + assert_equals(event.key, expected.shift()); + }); + if (!expected.length) { + t.done(); + } + } + + window.addEventListener('storage', onStorageEvent, false); + + var el = document.createElement("iframe"); + el.setAttribute('id', 'ifrm'); + el.setAttribute('src', 'iframe/local_set_item_clear_iframe.html'); + document.body.appendChild(el); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_newvalue.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_newvalue.html new file mode 100644 index 000000000..91a8c504c --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_newvalue.html @@ -0,0 +1,42 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + function fail(msg) { + t.step(function() { + assert_notreached(msg); + }); + t.done(); + } + </script> + </head> + <body> + <h1>event_local_newValue</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + var t = async_test("newValue property test of local event"); + var expected = ['user1', 'user2', null] + function onStorageEvent(event) { + t.step(function() { + assert_equals(event.newValue, expected.shift()); + }); + if (!expected.length) { + t.done(); + } + } + + window.addEventListener('storage', onStorageEvent, false); + + var el = document.createElement("iframe"); + el.setAttribute('id', 'ifrm'); + el.setAttribute('src', 'iframe/local_change_item_iframe.html'); + document.body.appendChild(el); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_oldvalue.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_oldvalue.html new file mode 100644 index 000000000..faf434001 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_oldvalue.html @@ -0,0 +1,42 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + function fail(msg) { + t.step(function() { + assert_notreached(msg); + }); + t.done(); + } + </script> + </head> + <body> + <h1>event_local_oldValue</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + var t = async_test("oldValue property test of local event"); + var expected = [null, 'user1', null] + function onStorageEvent(event) { + t.step(function() { + assert_equals(event.oldValue, expected.shift()); + }); + if (!expected.length) { + t.done(); + } + } + + window.addEventListener('storage', onStorageEvent, false); + + var el = document.createElement("iframe"); + el.setAttribute('id', 'ifrm'); + el.setAttribute('src', 'iframe/local_change_item_iframe.html'); + document.body.appendChild(el); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_storagearea.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_storagearea.html new file mode 100644 index 000000000..abe0113a8 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_storagearea.html @@ -0,0 +1,43 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + function fail(msg) { + t.step(function() { + assert_notreached(msg); + }); + t.done(); + } + </script> + </head> + <body> + <h1>event_local_storageArea</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + var t = async_test("storageArea property test of local event"); + function onStorageEvent(event) { + t.step(function() { + assert_equals(event.storageArea.length, 1); + var key = event.storageArea.key(0); + var value = event.storageArea.getItem(key); + assert_equals(key, "name"); + assert_equals(value, "user1"); + }); + t.done(); + } + + window.addEventListener('storage', onStorageEvent, false); + + var el = document.createElement("iframe"); + el.setAttribute('id', 'ifrm'); + el.setAttribute('src', 'iframe/local_set_item_iframe.html'); + document.body.appendChild(el); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_storageeventinit.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_storageeventinit.html new file mode 100644 index 000000000..36e5a19e8 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_storageeventinit.html @@ -0,0 +1,39 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>event_local_StorageEventInit</h1> + <div id="log"></div> + <script> + test(function() { + var t = async_test("storageeventinit test"); + function onStorageEvent(event) { + t.step(function() { + assert_equals(event.key, 'key'); + assert_equals(event.oldValue, 'oldValue'); + assert_equals(event.newValue, 'newValue'); + assert_equals(event.url, window.location.href); + assert_equals(event.storageArea, window.localStorage); + }); + t.done(); + } + + window.addEventListener('storage', onStorageEvent, false); + + var event = new StorageEvent('storage', { + key: 'key', + oldValue: 'oldValue', + newValue: 'newValue', + url: window.location.href, + storageArea: window.localStorage + }); + + window.dispatchEvent(event); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_url.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_url.html new file mode 100644 index 000000000..8a4e6fb53 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_url.html @@ -0,0 +1,47 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + function fail(msg) { + t.step(function() { + assert_notreached(msg); + }); + t.done(); + } + </script> + </head> + <body> + <h1>event_local_url</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + var t = async_test("url property test of local event"); + function onStorageEvent(event) { + t.step(function() { + var url = window.location.href; + + var pos = url.lastIndexOf("/"); + if (pos != -1) { + url = url.substr(0, pos + 1); + url = url + "iframe/local_set_item_iframe.html"; + } + + assert_equals(event.url, url); + }); + t.done(); + } + + window.addEventListener('storage', onStorageEvent, false); + + var el = document.createElement("iframe"); + el.setAttribute('id', 'ifrm'); + el.setAttribute('src', 'iframe/local_set_item_iframe.html'); + document.body.appendChild(el); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_key.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_key.html new file mode 100644 index 000000000..f976a6732 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_key.html @@ -0,0 +1,42 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + function fail(msg) { + t.step(function() { + assert_notreached(msg); + }); + t.done(); + } + </script> + </head> + <body> + <h1>event_session_key</h1> + <div id="log"></div> + <script> + test(function() { + sessionStorage.clear(); + var t = async_test("key property test of session event"); + var expected = ['name', null] + function onStorageEvent(event) { + t.step(function() { + assert_equals(event.key, expected.shift()); + }); + if (!expected.length) { + t.done(); + } + } + + window.addEventListener('storage', onStorageEvent, false); + + var el = document.createElement("iframe"); + el.setAttribute('id', 'ifrm'); + el.setAttribute('src', 'iframe/session_set_item_clear_iframe.html'); + document.body.appendChild(el); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_newvalue.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_newvalue.html new file mode 100644 index 000000000..b2358d323 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_newvalue.html @@ -0,0 +1,42 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + function fail(msg) { + t.step(function() { + assert_notreached(msg); + }); + t.done(); + } + </script> + </head> + <body> + <h1>event_session_newValue</h1> + <div id="log"></div> + <script> + test(function() { + sessionStorage.clear(); + var t = async_test("newvalue property test of session event"); + var expected = ['user1', 'user2', null] + function onStorageEvent(event) { + t.step(function() { + assert_equals(event.newValue, expected.shift()); + }); + if (!expected.length) { + t.done(); + } + } + + window.addEventListener('storage', onStorageEvent, false); + + var el = document.createElement("iframe"); + el.setAttribute('id', 'ifrm'); + el.setAttribute('src', 'iframe/session_change_item_iframe.html'); + document.body.appendChild(el); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_oldvalue.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_oldvalue.html new file mode 100644 index 000000000..b81c30921 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_oldvalue.html @@ -0,0 +1,42 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + function fail(msg) { + t.step(function() { + assert_notreached(msg); + }); + t.done(); + } + </script> + </head> + <body> + <h1>event_session_oldValue</h1> + <div id="log"></div> + <script> + test(function() { + sessionStorage.clear(); + var t = async_test("oldvalue property test of session event"); + var expected = [null, 'user1', null] + function onStorageEvent(event) { + t.step(function() { + assert_equals(event.oldValue, expected.shift()); + }); + if (!expected.length) { + t.done(); + } + } + + window.addEventListener('storage', onStorageEvent, false); + + var el = document.createElement("iframe"); + el.setAttribute('id', 'ifrm'); + el.setAttribute('src', 'iframe/session_change_item_iframe.html'); + document.body.appendChild(el); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_storagearea.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_storagearea.html new file mode 100644 index 000000000..f478e6d7f --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_storagearea.html @@ -0,0 +1,43 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + function fail(msg) { + t.step(function() { + assert_notreached(msg); + }); + t.done(); + } + </script> + </head> + <body> + <h1>event_session_storageArea</h1> + <div id="log"></div> + <script> + test(function() { + var t = async_test("storageArea property test of session event"); + function onStorageEvent(event) { + t.step(function() { + assert_equals(event.storageArea.length, 1); + var key = event.storageArea.key(0); + var value = event.storageArea.getItem(key); + assert_equals(key, "name"); + assert_equals(value, "user1"); + }); + t.done(); + } + + window.addEventListener('storage', onStorageEvent, false); + + var el = document.createElement("iframe"); + el.setAttribute('id', 'ifrm'); + el.setAttribute('src', 'iframe/session_set_item_iframe.html'); + document.body.appendChild(el); + }); + </script> + + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_storageeventinit.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_storageeventinit.html new file mode 100644 index 000000000..a2d2c1a73 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_storageeventinit.html @@ -0,0 +1,39 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>event_session_StorageEventInit</h1> + <div id="log"></div> + <script> + test(function() { + var t = async_test("storageeventinit test"); + function onStorageEvent(event) { + t.step(function() { + assert_equals(event.key, 'key'); + assert_equals(event.oldValue, 'oldValue'); + assert_equals(event.newValue, 'newValue'); + assert_equals(event.url, window.location.href); + assert_equals(event.storageArea, window.sessionStorage); + }); + t.done(); + } + + window.addEventListener('storage', onStorageEvent, false); + + var event = new StorageEvent('storage', { + key: 'key', + oldValue: 'oldValue', + newValue: 'newValue', + url: window.location.href, + storageArea: window.sessionStorage + }); + + window.dispatchEvent(event); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_url.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_url.html new file mode 100644 index 000000000..c4842bedc --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_url.html @@ -0,0 +1,47 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Web Storage</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + function fail(msg) { + t.step(function() { + assert_notreached(msg); + }); + t.done(); + } + </script> + </head> + <body> + <h1>event_session_url</h1> + <div id="log"></div> + <script> + test(function() { + sessionStorage.clear(); + var t = async_test("url property test of session event"); + function onStorageEvent(event) { + t.step(function() { + var url = window.location.href; + + var pos = url.lastIndexOf("/"); + if (pos != -1) { + url = url.substr(0, pos + 1); + url = url + "iframe/session_set_item_iframe.html"; + } + + assert_equals(event.url, url); + }); + t.done(); + } + + window.addEventListener('storage', onStorageEvent, false); + + var el = document.createElement("iframe"); + el.setAttribute('id', 'ifrm'); + el.setAttribute('src', 'iframe/session_set_item_iframe.html'); + document.body.appendChild(el); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_clear.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_clear.html new file mode 100644 index 000000000..39fd6d63a --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_clear.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.getItem("name"), null); + assert_equals(localStorage.length, 1); + + localStorage.clear(); + assert_equals(localStorage.getItem("name"), null, "localStorage.getItem('name')") + assert_equals(localStorage.length, 0, "localStorage.length") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_getitem.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_getitem.html new file mode 100644 index 000000000..a6872ac94 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_getitem.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_getItem</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + localStorage.setItem("name", "user1"); + localStorage.setItem("age", "20"); + test(function() { + assert_equals(localStorage.getItem("name"), "user1", "localStorage.getItem('name')") + assert_equals(localStorage.getItem("unknown"), null, "localStorage.getItem('unknown')") + }, "getItem method test") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_key.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_key.html new file mode 100644 index 000000000..7ec0acba4 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_key.html @@ -0,0 +1,40 @@ +<!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_key</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + + localStorage.setItem("name", "user1"); + localStorage.setItem("age", "20"); + localStorage.setItem("a", "1"); + localStorage.setItem("b", "2"); + + var keys = ["name", "age", "a", "b"]; + function doTest(index) { + test(function() { + var key = localStorage.key(index); + assert_not_equals(key, null); + assert_true(keys.indexOf(key) >= 0, + "Unexpected key " + key + " found."); + }, "key(" + index + ") should return the right thing."); + } + for (var i = 0; i < keys.length; ++i) { + doTest(i); + doTest(i + 0x100000000); + } + test(function() { + assert_equals(localStorage.key(-1), null, "localStorage.key(-1)"); + assert_equals(localStorage.key(4), null, "localStorage.key(4)"); + }, "key() should return null for out-of-range arguments."); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_length.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_length.html new file mode 100644 index 000000000..cf58cc7f4 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_length.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.setItem("name", "user1"); + localStorage.setItem("age", "20"); + + assert_equals(localStorage.length, 2, "localStorage.length") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_removeitem.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_removeitem.html new file mode 100644 index 000000000..67d336a00 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_removeitem.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_removeItem</h1> + <div id="log"></div> + <script> + test(function() { + localStorage.clear(); + localStorage.setItem("name", "user1"); + assert_equals(localStorage.getItem("name"), "user1"); + + localStorage.removeItem("name"); + localStorage.removeItem("unknown"); + assert_equals(localStorage.getItem("name"), null, "localStorage.getItem('name')") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_security.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_security.html new file mode 100644 index 000000000..4833d8a17 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_security.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>storage_local_security</h1>
+ <iframe id="frame" src="iframe/local_security_iframe.html" style="width: 0px; height: 0px;"></iframe>
+ <div id="log"></div>
+ <script>
+ var t1 = async_test('storage local security test');
+
+ iframeWindow = document.getElementById('frame').contentWindow;
+
+ setTimeout(function(){
+ try {
+ var errFlag =iframeWindow.localStorage.getItem("Security");
+ t1.step(function() {
+ assert_equals(errFlag, "true", 'SECURITY_ERR error is not raised.')
+ });
+ } catch (e) {
+ t1.step(function() {
+ assert_unreached('Error is raised.');
+ });
+ }
+ t1.done();
+ }, 500);
+ </script>
+ </body>
+</html>
diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_setitem.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_setitem.html new file mode 100644 index 000000000..1225d8a7b --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_setitem.html @@ -0,0 +1,19 @@ +<!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> + test(function() { + localStorage.clear(); + localStorage.setItem("name", "user1"); + assert_equals(localStorage.length, 1, "localStorage.setItem") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_clear.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_clear.html new file mode 100644 index 000000000..2d63a259a --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_clear.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.getItem("name"), null); + assert_equals(sessionStorage.length, 1); + + sessionStorage.clear(); + assert_equals(sessionStorage.getItem("name"), null, "sessionStorage.getItem('name')") + assert_equals(sessionStorage.length, 0, "sessionStorage.length") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_getitem.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_getitem.html new file mode 100644 index 000000000..8f0b04452 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_getitem.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_getItem</h1> + <div id="log"></div> + <script> + test(function() { + sessionStorage.clear(); + sessionStorage.setItem("name", "user1"); + sessionStorage.setItem("age", "20"); + test(function() { + assert_equals(sessionStorage.getItem("name"), "user1", "sessionStorage.getItem('name')") + assert_equals(sessionStorage.getItem("unknown"), null, "sessionStorage.getItem('unknown')") + }, "getItem method test") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_key.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_key.html new file mode 100644 index 000000000..31911f99c --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_key.html @@ -0,0 +1,40 @@ +<!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_key</h1> + <div id="log"></div> + <script> + test(function() { + sessionStorage.clear(); + + sessionStorage.setItem("name", "user1"); + sessionStorage.setItem("age", "20"); + sessionStorage.setItem("a", "1"); + sessionStorage.setItem("b", "2"); + + var keys = ["name", "age", "a", "b"]; + function doTest(index) { + test(function() { + var key = sessionStorage.key(index); + assert_not_equals(key, null); + assert_true(keys.indexOf(key) >= 0, + "Unexpected key " + key + " found."); + }, "key(" + index + ") should return the right thing."); + } + for (var i = 0; i < keys.length; ++i) { + doTest(i); + doTest(i + 0x100000000); + } + test(function() { + assert_equals(sessionStorage.key(-1), null, "sessionStorage.key(-1)"); + assert_equals(sessionStorage.key(4), null, "sessionStorage.key(4)"); + }, "key() should return null for out-of-range arguments."); + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_length.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_length.html new file mode 100644 index 000000000..daf06ccf6 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_length.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.setItem("name", "user1"); + sessionStorage.setItem("age", "20"); + + assert_equals(sessionStorage.length, 2, "sessionStorage.length") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_removeitem.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_removeitem.html new file mode 100644 index 000000000..7601f1e6e --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_removeitem.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_removeItem</h1> + <div id="log"></div> + <script> + test(function() { + sessionStorage.clear(); + sessionStorage.setItem("name", "user1"); + assert_equals(sessionStorage.getItem("name"), "user1"); + + sessionStorage.removeItem("name"); + sessionStorage.removeItem("unknown"); + assert_equals(sessionStorage.getItem("name"), null, "sessionStorage.getItem('name')") + }); + </script> + </body> +</html> diff --git a/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_setitem.html b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_setitem.html new file mode 100644 index 000000000..130d61e52 --- /dev/null +++ b/dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_setitem.html @@ -0,0 +1,19 @@ +<!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> + test(function() { + sessionStorage.clear(); + sessionStorage.setItem("name", "user1"); + assert_equals(sessionStorage.length, 1, "localStorage.setItem") + }); + </script> + </body> +</html> 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> diff --git a/dom/imptests/webapps/XMLHttpRequest/tests/submissions/Ms2ger/test_FormData-append.html b/dom/imptests/webapps/XMLHttpRequest/tests/submissions/Ms2ger/test_FormData-append.html new file mode 100644 index 000000000..b05c5169b --- /dev/null +++ b/dom/imptests/webapps/XMLHttpRequest/tests/submissions/Ms2ger/test_FormData-append.html @@ -0,0 +1,14 @@ +<!doctype html> +<meta charset=utf-8> +<title>FormData.append</title> +<link rel=help href=http://xhr.spec.whatwg.org/#dom-formdata-append> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<div id=log></div> +<script> +test(function() { + var fd = new FormData(); + fd.append("name", new String("value")); + // TODO: test that it actually worked. +}, "Passing a String object to FormData.append should work."); +</script> diff --git a/dom/imptests/webapps/XMLHttpRequest/tests/submissions/Ms2ger/test_interfaces.html b/dom/imptests/webapps/XMLHttpRequest/tests/submissions/Ms2ger/test_interfaces.html new file mode 100644 index 000000000..165d013d2 --- /dev/null +++ b/dom/imptests/webapps/XMLHttpRequest/tests/submissions/Ms2ger/test_interfaces.html @@ -0,0 +1,102 @@ +<!doctype html> +<meta charset=utf-8> +<title>XMLHttpRequest IDL tests</title> +<div id=log></div> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<script src=/resources/WebIDLParser.js></script> +<script src=/resources/idlharness.js></script> +<script type=text/plain class=untested> +interface EventTarget { + void addEventListener(DOMString type, EventListener? callback, optional boolean capture /* = false */); + void removeEventListener(DOMString type, EventListener? callback, optional boolean capture /* = false */); + boolean dispatchEvent(Event event); +}; +</script> +<script type=text/plain> +[NoInterfaceObject] +interface XMLHttpRequestEventTarget : EventTarget { + // event handlers + [TreatNonCallableAsNull] attribute Function? onloadstart; + [TreatNonCallableAsNull] attribute Function? onprogress; + [TreatNonCallableAsNull] attribute Function? onabort; + [TreatNonCallableAsNull] attribute Function? onerror; + [TreatNonCallableAsNull] attribute Function? onload; + [TreatNonCallableAsNull] attribute Function? ontimeout; + [TreatNonCallableAsNull] attribute Function? onloadend; +}; + +interface XMLHttpRequestUpload : XMLHttpRequestEventTarget { + +}; + +/* +enum XMLHttpRequestResponseType { + "", + "arraybuffer", + "blob", + "document", + "json", + "text" +}; +*/ + +[Constructor] +interface XMLHttpRequest : XMLHttpRequestEventTarget { + // event handler + [TreatNonCallableAsNull] attribute Function? onreadystatechange; + + // states + const unsigned short UNSENT = 0; + const unsigned short OPENED = 1; + const unsigned short HEADERS_RECEIVED = 2; + const unsigned short LOADING = 3; + const unsigned short DONE = 4; + readonly attribute unsigned short readyState; + + // request + void open(DOMString method, DOMString url, optional boolean async/* = true*/, optional DOMString? user, optional DOMString? password); + void setRequestHeader(DOMString header, DOMString value); + attribute unsigned long timeout; + attribute boolean withCredentials; + readonly attribute XMLHttpRequestUpload upload; + void send(optional (ArrayBufferView or Blob or Document or DOMString or FormData)? data/* = null*/); + void abort(); + + // response + readonly attribute unsigned short status; + readonly attribute DOMString statusText; + DOMString? getResponseHeader(DOMString header); + DOMString getAllResponseHeaders(); + void overrideMimeType(DOMString mime); +/* attribute XMLHttpRequestResponseType responseType; */ + readonly attribute any response; + readonly attribute DOMString responseText; + readonly attribute Document? responseXML; +}; + +[Constructor, + Constructor(HTMLFormElement form)] +interface FormData { + void append(DOMString name, Blob value, optional DOMString filename); + void append(DOMString name, DOMString value); +}; +</script> +<script> +"use strict"; +var form = document.createElement("form"); +var idlArray = new IdlArray(); +[].forEach.call(document.querySelectorAll("script[type=text\\/plain]"), function(node) { + if (node.className == "untested") { + idlArray.add_untested_idls(node.textContent); + } else { + idlArray.add_idls(node.textContent); + } +}); +idlArray.add_objects({ + XMLHttpRequest: ['new XMLHttpRequest()'], + XMLHttpRequestUpload: ['(new XMLHttpRequest()).upload'], + FormData: ['new FormData()', 'new FormData(form)'] +}); +idlArray.test(); +</script> diff --git a/dom/imptests/webapps/XMLHttpRequest/tests/submissions/Ms2ger/test_setrequestheader-invalid-arguments.htm b/dom/imptests/webapps/XMLHttpRequest/tests/submissions/Ms2ger/test_setrequestheader-invalid-arguments.htm new file mode 100644 index 000000000..a077ad95f --- /dev/null +++ b/dom/imptests/webapps/XMLHttpRequest/tests/submissions/Ms2ger/test_setrequestheader-invalid-arguments.htm @@ -0,0 +1,42 @@ +<!doctype html> +<html> + <head> + <title>XMLHttpRequest: setRequestHeader() with invalid arguments</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id="log"></div> +<!-- + CHAR = <any US-ASCII character (octets 0 - 127)> + CTL = <any US-ASCII control character + (octets 0 - 31) and DEL (127)> + SP = <US-ASCII SP, space (32)> + HT = <US-ASCII HT, horizontal-tab (9)> + token = 1*<any CHAR except CTLs or separators> + separators = "(" | ")" | "<" | ">" | "@" + | "," | ";" | ":" | "\" | <"> + | "/" | "[" | "]" | "?" | "=" + | "{" | "}" | SP | HT + field-name = token +--> + <script> + var invalid_headers = ["(", ")", "<", ">", "@", ",", ";", ":", "\\", + "\"", "/", "[", "]", "?", "=", "{", "}", " ", + "\u0009", "\u007f"] + for (var i = 0; i < 32; ++i) { + invalid_headers.push(String.fromCharCode(i)) + } + for (var i = 0; i < invalid_headers.length; ++i) { + test(function() { + assert_throws("SYNTAX_ERR", function() { + var client = new XMLHttpRequest() + client.open("GET", "../resources/delay.php?ms=0") + client.setRequestHeader(invalid_headers[i], "test") + }, "setRequestHeader should throw with header " + + format_value(invalid_headers[i]) +".") + }) + } + </script> + </body> +</html> diff --git a/dom/imptests/webapps/mochitest.ini b/dom/imptests/webapps/mochitest.ini new file mode 100644 index 000000000..0eea5c631 --- /dev/null +++ b/dom/imptests/webapps/mochitest.ini @@ -0,0 +1,60 @@ +# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT +[DEFAULT] +support-files = + WebStorage/tests/submissions/Infraware/iframe/local_change_item_iframe.html + WebStorage/tests/submissions/Infraware/iframe/local_security_iframe.html + WebStorage/tests/submissions/Infraware/iframe/local_set_item_clear_iframe.html + WebStorage/tests/submissions/Infraware/iframe/local_set_item_iframe.html + WebStorage/tests/submissions/Infraware/iframe/session_change_item_iframe.html + WebStorage/tests/submissions/Infraware/iframe/session_set_item_clear_iframe.html + WebStorage/tests/submissions/Infraware/iframe/session_set_item_iframe.html + WebStorage/tests/submissions/Ms2ger/storage_builtins.js + +[WebStorage/tests/submissions/Infraware/test_event_constructor.html] +[WebStorage/tests/submissions/Infraware/test_event_local_key.html] +[WebStorage/tests/submissions/Infraware/test_event_local_newvalue.html] +[WebStorage/tests/submissions/Infraware/test_event_local_oldvalue.html] +[WebStorage/tests/submissions/Infraware/test_event_local_storagearea.html] +[WebStorage/tests/submissions/Infraware/test_event_local_storageeventinit.html] +[WebStorage/tests/submissions/Infraware/test_event_local_url.html] +[WebStorage/tests/submissions/Infraware/test_event_session_key.html] +[WebStorage/tests/submissions/Infraware/test_event_session_newvalue.html] +[WebStorage/tests/submissions/Infraware/test_event_session_oldvalue.html] +[WebStorage/tests/submissions/Infraware/test_event_session_storagearea.html] +[WebStorage/tests/submissions/Infraware/test_event_session_storageeventinit.html] +[WebStorage/tests/submissions/Infraware/test_event_session_url.html] +[WebStorage/tests/submissions/Infraware/test_storage_local_clear.html] +[WebStorage/tests/submissions/Infraware/test_storage_local_getitem.html] +[WebStorage/tests/submissions/Infraware/test_storage_local_key.html] +skip-if = toolkit == 'android' #bug 775227 +[WebStorage/tests/submissions/Infraware/test_storage_local_length.html] +[WebStorage/tests/submissions/Infraware/test_storage_local_removeitem.html] +[WebStorage/tests/submissions/Infraware/test_storage_local_security.html] +[WebStorage/tests/submissions/Infraware/test_storage_local_setitem.html] +[WebStorage/tests/submissions/Infraware/test_storage_session_clear.html] +[WebStorage/tests/submissions/Infraware/test_storage_session_getitem.html] +[WebStorage/tests/submissions/Infraware/test_storage_session_key.html] +[WebStorage/tests/submissions/Infraware/test_storage_session_length.html] +[WebStorage/tests/submissions/Infraware/test_storage_session_removeitem.html] +[WebStorage/tests/submissions/Infraware/test_storage_session_setitem.html] +[WebStorage/tests/submissions/Ms2ger/test_event_constructor_js.html] +[WebStorage/tests/submissions/Ms2ger/test_missing_arguments.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_local_builtins.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_local_clear_js.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_local_getitem_js.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_local_in_js.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_local_index_js.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_local_length_js.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_local_removeitem_js.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_local_setitem_js.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_session_builtins.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_session_clear_js.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_session_getitem_js.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_session_in_js.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_session_index_js.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_session_length_js.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_session_removeitem_js.html] +[WebStorage/tests/submissions/Ms2ger/test_storage_session_setitem_js.html] +[XMLHttpRequest/tests/submissions/Ms2ger/test_FormData-append.html] +[XMLHttpRequest/tests/submissions/Ms2ger/test_interfaces.html] +[XMLHttpRequest/tests/submissions/Ms2ger/test_setrequestheader-invalid-arguments.htm] |