diff options
Diffstat (limited to 'testing/web-platform/tests/webstorage/resources')
12 files changed, 225 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webstorage/resources/event_body_handler.html b/testing/web-platform/tests/webstorage/resources/event_body_handler.html new file mode 100644 index 000000000..11d8ec944 --- /dev/null +++ b/testing/web-platform/tests/webstorage/resources/event_body_handler.html @@ -0,0 +1,14 @@ +<!DOCTYPE HTML> +<html> +<head> +<script> + +function handleStorageEvent(e) { + window.parent.storageEventList.push(e); +} + +</script> +</head> +<body onstorage="handleStorageEvent(event);"> +</body> +</html> diff --git a/testing/web-platform/tests/webstorage/resources/event_setattribute_handler.html b/testing/web-platform/tests/webstorage/resources/event_setattribute_handler.html new file mode 100644 index 000000000..b9e2f0402 --- /dev/null +++ b/testing/web-platform/tests/webstorage/resources/event_setattribute_handler.html @@ -0,0 +1,15 @@ +<!DOCTYPE HTML> +<html> +<head></head> +<body> +<script> + +function handleStorageEvent(e) { + window.parent.storageEventList.push(e); +} + +document.body.setAttribute("onstorage", "handleStorageEvent(event);"); + +</script> +</body> +</html> diff --git a/testing/web-platform/tests/webstorage/resources/local_change_item_iframe.html b/testing/web-platform/tests/webstorage/resources/local_change_item_iframe.html new file mode 100644 index 000000000..17be8fb26 --- /dev/null +++ b/testing/web-platform/tests/webstorage/resources/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/testing/web-platform/tests/webstorage/resources/local_set_item_clear_iframe.html b/testing/web-platform/tests/webstorage/resources/local_set_item_clear_iframe.html new file mode 100644 index 000000000..742b7dad1 --- /dev/null +++ b/testing/web-platform/tests/webstorage/resources/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/testing/web-platform/tests/webstorage/resources/local_set_item_iframe.html b/testing/web-platform/tests/webstorage/resources/local_set_item_iframe.html new file mode 100644 index 000000000..0693824e5 --- /dev/null +++ b/testing/web-platform/tests/webstorage/resources/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/testing/web-platform/tests/webstorage/resources/local_set_item_remove_iframe.html b/testing/web-platform/tests/webstorage/resources/local_set_item_remove_iframe.html new file mode 100644 index 000000000..7451594c8 --- /dev/null +++ b/testing/web-platform/tests/webstorage/resources/local_set_item_remove_iframe.html @@ -0,0 +1,11 @@ +<!DOCTYPE HTML> +<html> + <body> + <script> + parent.step(function() { + localStorage.setItem("name", "user1"); + localStorage.removeItem('name'); + }); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/webstorage/resources/session_change_item_iframe.html b/testing/web-platform/tests/webstorage/resources/session_change_item_iframe.html new file mode 100644 index 000000000..1e1867e51 --- /dev/null +++ b/testing/web-platform/tests/webstorage/resources/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/testing/web-platform/tests/webstorage/resources/session_set_item_clear_iframe.html b/testing/web-platform/tests/webstorage/resources/session_set_item_clear_iframe.html new file mode 100644 index 000000000..7deaa9b17 --- /dev/null +++ b/testing/web-platform/tests/webstorage/resources/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/testing/web-platform/tests/webstorage/resources/session_set_item_iframe.html b/testing/web-platform/tests/webstorage/resources/session_set_item_iframe.html new file mode 100644 index 000000000..de844cca4 --- /dev/null +++ b/testing/web-platform/tests/webstorage/resources/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/testing/web-platform/tests/webstorage/resources/session_set_item_remove_iframe.html b/testing/web-platform/tests/webstorage/resources/session_set_item_remove_iframe.html new file mode 100644 index 000000000..60303e70f --- /dev/null +++ b/testing/web-platform/tests/webstorage/resources/session_set_item_remove_iframe.html @@ -0,0 +1,11 @@ +<!DOCTYPE HTML> +<html> + <body> + <script> + parent.step(function() { + sessionStorage.setItem("name", "user1"); + sessionStorage.removeItem('name'); + }); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/webstorage/resources/storage_local_window_open_second.html b/testing/web-platform/tests/webstorage/resources/storage_local_window_open_second.html new file mode 100644 index 000000000..3c8405adc --- /dev/null +++ b/testing/web-platform/tests/webstorage/resources/storage_local_window_open_second.html @@ -0,0 +1,36 @@ +<!DOCTYPE HTML> +<html> +<head> +<title>WebStorage Test: localStorage - second page</title> +</head> +<body> +<script> + +var storage = window.localStorage; + +var assertions = []; + +assertions.push({ + actual: storage.getItem("FOO"), + expected: "BAR", + message: "storage.getItem('FOO')" +}); + +storage.setItem("FOO", "BAR-NEWWINDOW"); + +assertions.push({ + actual: storage.getItem("FOO"), + expected: "BAR-NEWWINDOW", + message: "value for FOO after changing" +}); +assertions.push({ + actual: window.opener.localStorage.getItem("FOO"), + expected: "BAR-NEWWINDOW", + message: "value for FOO in my opening window" +}); + +window.opener.postMessage(assertions, '*'); + +</script> +</body> +</html> diff --git a/testing/web-platform/tests/webstorage/resources/storage_session_window_open_second.html b/testing/web-platform/tests/webstorage/resources/storage_session_window_open_second.html new file mode 100644 index 000000000..bc134af32 --- /dev/null +++ b/testing/web-platform/tests/webstorage/resources/storage_session_window_open_second.html @@ -0,0 +1,36 @@ +<!DOCTYPE HTML> +<html> +<head> +<title>WebStorage Test: sessionStorage - second page</title> +</head> +<body> +<script> + +var storage = window.sessionStorage; + +var assertions = []; + +assertions.push({ + actual: storage.getItem("FOO"), + expected: "BAR", + message: "storage.getItem('FOO')" +}); + +storage.setItem("FOO", "BAR-NEWWINDOW"); + +assertions.push({ + actual: storage.getItem("FOO"), + expected: "BAR-NEWWINDOW", + message: "value for FOO after changing" +}); +assertions.push({ + actual: window.opener.sessionStorage.getItem("FOO"), + expected: "BAR", + message: "value for FOO in my opening window" +}); + +window.opener.postMessage(assertions, '*'); + +</script> +</body> +</html> |