mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-02 05:17:31 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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");
|
||||
});
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
60
dom/imptests/webapps/mochitest.ini
Normal file
60
dom/imptests/webapps/mochitest.ini
Normal file
|
|
@ -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]
|
||||
Loading…
Add table
Add a link
Reference in a new issue