mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
Bug 765177 - Part a: Update WebStorage tests; r=bz
This commit is contained in:
parent
c403b93455
commit
0694b06721
@ -12,6 +12,7 @@ include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_TESTS = \
|
||||
test_missing_arguments.html.json \
|
||||
test_storage_local_in_js.html.json \
|
||||
test_storage_local_removeitem_js.html.json \
|
||||
test_storage_session_in_js.html.json \
|
||||
|
@ -0,0 +1,13 @@
|
||||
{
|
||||
"Should throw TypeError for function \"function () {\n localStorage.key();\n}\".": true,
|
||||
"Should throw TypeError for function \"function () {\n localStorage.getItem();\n}\".": true,
|
||||
"Should throw TypeError for function \"function () {\n localStorage.setItem();\n}\".": true,
|
||||
"Should throw TypeError for function \"function () {\n localStorage.setItem(\"a\");\n}\".": true,
|
||||
"Should throw TypeError for function \"function () {\n localStorage.removeItem();\n}\".": true,
|
||||
"Should throw TypeError for function \"function () {\n sessionStorage.key();\n}\".": true,
|
||||
"Should throw TypeError for function \"function () {\n sessionStorage.getItem();\n}\".": true,
|
||||
"Should throw TypeError for function \"function () {\n sessionStorage.setItem();\n}\".": true,
|
||||
"Should throw TypeError for function \"function () {\n sessionStorage.setItem(\"a\");\n}\".": true,
|
||||
"Should throw TypeError for function \"function () {\n sessionStorage.removeItem();\n}\".": true,
|
||||
"Should throw TypeError for function \"function () {\n new StorageEvent;\n}\".": true
|
||||
}
|
@ -15,6 +15,7 @@ include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_TESTS = \
|
||||
test_event_constructor_js.html \
|
||||
test_missing_arguments.html \
|
||||
test_storage_local_clear_js.html \
|
||||
test_storage_local_getitem_js.html \
|
||||
test_storage_local_index_js.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>
|
Loading…
x
Reference in New Issue
Block a user