mirror of
https://github.com/servo/servo.git
synced 2025-08-14 18:05:36 +01:00
Update web-platform-tests to revision 4d96cccabc2feacd48e1dab9afc22b8af2225572
This commit is contained in:
parent
0d236288cc
commit
c66c6af0ba
1067 changed files with 63768 additions and 10900 deletions
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: StorageEvent - init value</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
|
@ -26,7 +26,7 @@
|
|||
window.addEventListener('storage', onStorageEvent, false);
|
||||
var event = new StorageEvent('storage');
|
||||
window.dispatchEvent(event);
|
||||
});
|
||||
}, "The initial values of storage event properties.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: StorageEvent - StorageEventInit with null value</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
|
@ -31,7 +31,7 @@
|
|||
url: null
|
||||
});
|
||||
window.dispatchEvent(event);
|
||||
});
|
||||
}, "Construct StorageEvent with StorageEventInit.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: localStorage event - key</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
@ -17,9 +17,10 @@
|
|||
<h1>event_local_key</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test("key property test of local event");
|
||||
|
||||
test(function() {
|
||||
localStorage.clear();
|
||||
var t = async_test("key property test of local event");
|
||||
var expected = ['name', null]
|
||||
function onStorageEvent(event) {
|
||||
t.step(function() {
|
||||
|
@ -36,7 +37,7 @@
|
|||
el.setAttribute('id', 'ifrm');
|
||||
el.setAttribute('src', 'iframe/local_set_item_clear_iframe.html');
|
||||
document.body.appendChild(el);
|
||||
});
|
||||
}, "Local event is fired due to an invocation of the setItem(), clear() methods.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: localStorage event - newValue</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
@ -17,9 +17,10 @@
|
|||
<h1>event_local_newValue</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test("newValue property test of local event");
|
||||
|
||||
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() {
|
||||
|
@ -36,7 +37,7 @@
|
|||
el.setAttribute('id', 'ifrm');
|
||||
el.setAttribute('src', 'iframe/local_change_item_iframe.html');
|
||||
document.body.appendChild(el);
|
||||
});
|
||||
}, "Local event is fired due to an invocation of the setItem(), clear() methods.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: localStorage event - oldValue</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
@ -17,9 +17,10 @@
|
|||
<h1>event_local_oldValue</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test("oldValue property test of local event");
|
||||
|
||||
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() {
|
||||
|
@ -36,7 +37,7 @@
|
|||
el.setAttribute('id', 'ifrm');
|
||||
el.setAttribute('src', 'iframe/local_change_item_iframe.html');
|
||||
document.body.appendChild(el);
|
||||
});
|
||||
}, "Local event is fired due to an invocation of the setItem(), clear() methods.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE HTML>
|
||||
<meta charset="utf-8">
|
||||
<title>Web Storage Test: event - localStorage removeItem</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<div id="log"></div>
|
||||
|
||||
<script>
|
||||
|
||||
var t = async_test("key property test of local event");
|
||||
|
||||
t.step(function() {
|
||||
localStorage.clear();
|
||||
|
||||
var event_index = 0;
|
||||
window.addEventListener('storage', t.step_func(function(event) {
|
||||
switch(++event_index) {
|
||||
case 1:
|
||||
assert_equals(event.key, "name", "set key");
|
||||
assert_equals(event.oldValue, null, "set oldValue");
|
||||
assert_equals(event.newValue, "user1", "set newValue");
|
||||
assert_equals(event.url, el.contentDocument.documentURI, "set url");
|
||||
assert_equals(event.storageArea, localStorage, "set storageArea");
|
||||
break;
|
||||
case 2:
|
||||
assert_equals(event.key, "name", "remove key");
|
||||
assert_equals(event.oldValue, "user1", "remove oldValue");
|
||||
assert_equals(event.newValue, null, "remove newValue");
|
||||
assert_equals(event.url, el.contentDocument.documentURI, "remove url");
|
||||
assert_equals(event.storageArea, localStorage, "remove storageArea");
|
||||
t.done();
|
||||
break;
|
||||
}
|
||||
}), false);
|
||||
|
||||
var el = document.createElement("iframe");
|
||||
el.setAttribute('id', 'ifrm');
|
||||
el.setAttribute('src', 'iframe/local_set_item_remove_iframe.html');
|
||||
document.body.appendChild(el);
|
||||
});
|
||||
|
||||
</script>
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: localStorage event - storageArea</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
@ -17,9 +17,10 @@
|
|||
<h1>event_local_storageArea</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test("storageArea property test of local event");
|
||||
|
||||
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);
|
||||
|
@ -37,7 +38,7 @@
|
|||
el.setAttribute('id', 'ifrm');
|
||||
el.setAttribute('src', 'iframe/local_set_item_iframe.html');
|
||||
document.body.appendChild(el);
|
||||
});
|
||||
}, "Local event is fired due to an invocation of the setItem() method.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: localStorage event - StorageEventInit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
|
@ -33,7 +33,7 @@
|
|||
});
|
||||
|
||||
window.dispatchEvent(event);
|
||||
});
|
||||
}, "Storage event is fired due to set values for StorageEventInit.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: localStorage event - url</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
@ -17,9 +17,10 @@
|
|||
<h1>event_local_url</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test("url property test of local event");
|
||||
|
||||
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;
|
||||
|
@ -41,7 +42,7 @@
|
|||
el.setAttribute('id', 'ifrm');
|
||||
el.setAttribute('src', 'iframe/local_set_item_iframe.html');
|
||||
document.body.appendChild(el);
|
||||
});
|
||||
}, "Local event is fired due to an invocation of the setItem() method.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: sessionStorage event - key</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
@ -17,9 +17,10 @@
|
|||
<h1>event_session_key</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test("key property test of session event");
|
||||
|
||||
test(function() {
|
||||
sessionStorage.clear();
|
||||
var t = async_test("key property test of session event");
|
||||
var expected = ['name', null]
|
||||
function onStorageEvent(event) {
|
||||
t.step(function() {
|
||||
|
@ -36,7 +37,7 @@
|
|||
el.setAttribute('id', 'ifrm');
|
||||
el.setAttribute('src', 'iframe/session_set_item_clear_iframe.html');
|
||||
document.body.appendChild(el);
|
||||
});
|
||||
}, "Session event is fired due to an invocation of the setItem(), clear() methods.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: sessionStorage event - newValue</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
@ -17,9 +17,10 @@
|
|||
<h1>event_session_newValue</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test("newvalue property test of session event");
|
||||
|
||||
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() {
|
||||
|
@ -36,7 +37,7 @@
|
|||
el.setAttribute('id', 'ifrm');
|
||||
el.setAttribute('src', 'iframe/session_change_item_iframe.html');
|
||||
document.body.appendChild(el);
|
||||
});
|
||||
}, "Session event is fired due to an invocation of the setItem(), clear() methods.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: sessionStorage event - oldValue</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
@ -17,9 +17,10 @@
|
|||
<h1>event_session_oldValue</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test("oldvalue property test of session event");
|
||||
|
||||
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() {
|
||||
|
@ -36,7 +37,7 @@
|
|||
el.setAttribute('id', 'ifrm');
|
||||
el.setAttribute('src', 'iframe/session_change_item_iframe.html');
|
||||
document.body.appendChild(el);
|
||||
});
|
||||
}, "Session event is fired due to an invocation of the setItem(), clear() methods.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE HTML>
|
||||
<meta charset="utf-8">
|
||||
<title>Web Storage Test: event - sessionStorage removeItem</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<div id="log"></div>
|
||||
|
||||
<script>
|
||||
|
||||
var t = async_test("key property test of session event");
|
||||
|
||||
t.step(function() {
|
||||
sessionStorage.clear();
|
||||
|
||||
var event_index = 0;
|
||||
window.addEventListener('storage', t.step_func(function(event) {
|
||||
switch(++event_index) {
|
||||
case 1:
|
||||
assert_equals(event.key, "name", "set key");
|
||||
assert_equals(event.oldValue, null, "set oldValue");
|
||||
assert_equals(event.newValue, "user1", "set newValue");
|
||||
assert_equals(event.url, el.contentDocument.documentURI, "set url");
|
||||
assert_equals(event.storageArea, sessionStorage, "set storageArea");
|
||||
break;
|
||||
case 2:
|
||||
assert_equals(event.key, "name", "remove key");
|
||||
assert_equals(event.oldValue, "user1", "remove oldValue");
|
||||
assert_equals(event.newValue, null, "remove newValue");
|
||||
assert_equals(event.url, el.contentDocument.documentURI, "remove url");
|
||||
assert_equals(event.storageArea, sessionStorage, "remove storageArea");
|
||||
t.done();
|
||||
break;
|
||||
}
|
||||
}), false);
|
||||
|
||||
var el = document.createElement("iframe");
|
||||
el.setAttribute('id', 'ifrm');
|
||||
el.setAttribute('src', 'iframe/session_set_item_remove_iframe.html');
|
||||
document.body.appendChild(el);
|
||||
});
|
||||
</script>
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: sessionStorage event - storageArea</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
@ -17,8 +17,9 @@
|
|||
<h1>event_session_storageArea</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test("storageArea property test of session event");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("storageArea property test of session event");
|
||||
function onStorageEvent(event) {
|
||||
t.step(function() {
|
||||
assert_equals(event.storageArea.length, 1);
|
||||
|
@ -36,7 +37,7 @@
|
|||
el.setAttribute('id', 'ifrm');
|
||||
el.setAttribute('src', 'iframe/session_set_item_iframe.html');
|
||||
document.body.appendChild(el);
|
||||
});
|
||||
}, "Session event is fired due to an invocation of the setItem() method.");
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: sessionStorage event - StorageEventInit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
|
@ -33,7 +33,7 @@
|
|||
});
|
||||
|
||||
window.dispatchEvent(event);
|
||||
});
|
||||
}, "Storage event is fired due to set values for StorageEventInit.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: sessionStorage event - url</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
@ -17,9 +17,10 @@
|
|||
<h1>event_session_url</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test("url property test of session event");
|
||||
|
||||
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;
|
||||
|
@ -41,7 +42,7 @@
|
|||
el.setAttribute('id', 'ifrm');
|
||||
el.setAttribute('src', 'iframe/session_set_item_iframe.html');
|
||||
document.body.appendChild(el);
|
||||
});
|
||||
}, "Session event is fired due to an invocation of the setItem() method.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<script>
|
||||
parent.t.step(function() {
|
||||
localStorage.setItem("name", "user1");
|
||||
localStorage.removeItem('name');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<script>
|
||||
parent.t.step(function() {
|
||||
sessionStorage.setItem("name", "user1");
|
||||
sessionStorage.removeItem('name');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: missing arguments</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE HTML>
|
||||
<mete charset=utf-8>
|
||||
<title>Builtins</title>
|
||||
<title>WebStorage Test: Storage - builtins</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE HTML>
|
||||
<mete charset=utf-8>
|
||||
<title>Clear</title>
|
||||
<title>WebStorage Test: Storage - clear()</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE HTML>
|
||||
<mete charset=utf-8>
|
||||
<title>getItem and named getter</title>
|
||||
<title>WebStorage Test: Storage - getItem(key) and named getter</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
|
@ -37,6 +37,6 @@
|
|||
assert_equals(storage.getItem(null), "bar", "storage.getItem(null)")
|
||||
assert_equals(storage.getItem(""), "baz", "storage.getItem('')")
|
||||
}, name + ".getItem should be correct")
|
||||
}, "Builtins in " + name);
|
||||
}, "Get value by getIten(key) and named access in " + name + ".");
|
||||
});
|
||||
</script>
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE HTML>
|
||||
<mete charset=utf-8>
|
||||
<title>The in operator</title>
|
||||
<title>WebStorage Test: Storage - in operator</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE HTML>
|
||||
<mete charset=utf-8>
|
||||
<title>Indexed getter</title>
|
||||
<title>WebStorage Test: Storage - indexed getter</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE HTML>
|
||||
<mete charset=utf-8>
|
||||
<title>Key</title>
|
||||
<title>WebStorage Test: Storage - key(index)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>WebStorage Test: Storage - key with empty string</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
["localStorage", "sessionStorage"].forEach(function(name) {
|
||||
test(function () {
|
||||
var storage = window[name];
|
||||
storage.clear();
|
||||
|
||||
storage.setItem("", "empty string");
|
||||
assert_equals(storage.getItem(""), "empty string");
|
||||
|
||||
}, name + ".key with empty string");
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE HTML>
|
||||
<mete charset=utf-8>
|
||||
<title>Length</title>
|
||||
<title>WebStorage Test: Storage - length</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>WebStorage Test: local storage</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<meta name="flags" content="interact">
|
||||
|
||||
<h2>Description</h2>
|
||||
<p>
|
||||
This test validates that store data using Local Storage which means that close the page, and re-open it, the data saved before should be loaded again.
|
||||
</p>
|
||||
|
||||
<h2>Preconditions</h2>
|
||||
<ol class="instructions">
|
||||
<li>
|
||||
Click the "Clear" button, refresh the page once and then check if the page shows "You have viewed this page 1 time(s)"
|
||||
</li>
|
||||
<li>
|
||||
Close the page, re-open it and then check if the page still shows "You have viewed this page 2 time(s)"
|
||||
</li>
|
||||
<li>
|
||||
If the above two steps are all true the test case pass, otherwise it fail
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
<h2>You have viewed this page
|
||||
<span id="count">an untold number of</span>
|
||||
time(s).</h2>
|
||||
<button type="button" onclick="javascript:localStorage.pageLoadCount = 0;"><h3>Clear</h3></button>
|
||||
</p>
|
||||
|
||||
<script>
|
||||
|
||||
if (!localStorage.pageLoadCount) {
|
||||
localStorage.pageLoadCount = 0;
|
||||
}
|
||||
localStorage.pageLoadCount = parseInt(localStorage.pageLoadCount) + 1;
|
||||
document.getElementById('count').textContent = localStorage.pageLoadCount;
|
||||
|
||||
</script>
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: localStorage - setItem throws QuotaExceededError</title>
|
||||
<meta name="timeout" content="long">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
@ -25,7 +25,7 @@
|
|||
});
|
||||
|
||||
localStorage.clear();
|
||||
});
|
||||
}, "Throws QuotaExceededError when the quota of " + name + " has been exceeded");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE HTML>
|
||||
<mete charset=utf-8>
|
||||
<title>RemoveItem</title>
|
||||
<title>WebStorage Test: Storage - removeItem(key)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>WebStorage Test: session storage</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<meta name="flags" content="interact">
|
||||
|
||||
<h2>Description</h2>
|
||||
<p>
|
||||
This test validates that store the data using Session Storage which means that even if you close the page, and re-open it, the data saved before should be lost.
|
||||
</p>
|
||||
|
||||
<ol class="instructions">
|
||||
<li>
|
||||
Click the "Clear" button, refresh the page once and then check if the page shows "You have viewed this page 1 time(s)"
|
||||
</li>
|
||||
<li>
|
||||
Close the page, re-open it and then check if the page still shows "You have viewed this page 1 time(s)"
|
||||
</li>
|
||||
<li>
|
||||
If the above two steps are all true the test case pass, otherwise it fail.<br>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
<h2>You have viewed this page
|
||||
<span id="count">an untold number of</span>
|
||||
time(s).</h2>
|
||||
<button type="button" onclick="javascript:sessionStorage.pageLoadCount = 0;"><h3>Clear</h3></button>
|
||||
</p>
|
||||
|
||||
<script>
|
||||
|
||||
if (!sessionStorage.pageLoadCount) {
|
||||
sessionStorage.pageLoadCount = 0;
|
||||
}
|
||||
sessionStorage.pageLoadCount = parseInt(sessionStorage.pageLoadCount) + 1;
|
||||
document.getElementById('count').textContent = sessionStorage.pageLoadCount;
|
||||
|
||||
</script>
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Web Storage</title>
|
||||
<title>WebStorage Test: sessionStorage - setItem throws QuotaExceededError</title>
|
||||
<meta name="timeout" content="long">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
@ -25,7 +25,7 @@
|
|||
});
|
||||
|
||||
sessionStorage.clear();
|
||||
});
|
||||
}, "Throws QuotaExceededError when the quota of " + name + " has been exceeded");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>WebStorage Test: Storage - set value with enumerate</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var store_list = [
|
||||
["key0", "value0"],
|
||||
["key1", "value1"],
|
||||
["key2", "value2"]
|
||||
];
|
||||
["localStorage", "sessionStorage"].forEach(function(name) {
|
||||
test(function () {
|
||||
var storage = window[name];
|
||||
storage.clear();
|
||||
|
||||
store_list.forEach(function(item) {
|
||||
storage.setItem(item[0], item[1]);
|
||||
});
|
||||
|
||||
for (var i = 0; i < store_list.length; i++) {
|
||||
var value = storage.getItem("key" + i);
|
||||
assert_equals(value, "value" + i);
|
||||
}
|
||||
}, "enumerate a " + name + " object with the key and get the values");
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE HTML>
|
||||
<mete charset=utf-8>
|
||||
<title>SetItem</title>
|
||||
<title>WebStorage Test: Storage - setItem(key, value)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
Loading…
Add table
Add a link
Reference in a new issue