mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Update web-platform-tests to revision 87398b8448f699e3e324148795891658f2fa16dd
This commit is contained in:
parent
836463b9e0
commit
3fb5197361
72 changed files with 1293 additions and 348 deletions
|
@ -11469,6 +11469,10 @@
|
||||||
"path": "IndexedDB/value_recursive.htm",
|
"path": "IndexedDB/value_recursive.htm",
|
||||||
"url": "/IndexedDB/value_recursive.htm"
|
"url": "/IndexedDB/value_recursive.htm"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "WebCryptoAPI/getRandomValues.worker.js",
|
||||||
|
"url": "/WebCryptoAPI/getRandomValues.worker"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "WebCryptoAPI/test_getRandomValues.html",
|
"path": "WebCryptoAPI/test_getRandomValues.html",
|
||||||
"url": "/WebCryptoAPI/test_getRandomValues.html"
|
"url": "/WebCryptoAPI/test_getRandomValues.html"
|
||||||
|
@ -13385,6 +13389,10 @@
|
||||||
"path": "domparsing/DOMParser-parseFromString-xml.html",
|
"path": "domparsing/DOMParser-parseFromString-xml.html",
|
||||||
"url": "/domparsing/DOMParser-parseFromString-xml.html"
|
"url": "/domparsing/DOMParser-parseFromString-xml.html"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "domparsing/XMLSerializer-serializeToString.html",
|
||||||
|
"url": "/domparsing/XMLSerializer-serializeToString.html"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "domparsing/insert-adjacent.html",
|
"path": "domparsing/insert-adjacent.html",
|
||||||
"url": "/domparsing/insert-adjacent.html"
|
"url": "/domparsing/insert-adjacent.html"
|
||||||
|
@ -16237,6 +16245,10 @@
|
||||||
"path": "html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_04.html",
|
"path": "html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_04.html",
|
||||||
"url": "/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_04.html"
|
"url": "/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_04.html"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "html/semantics/embedded-content/the-img-element/Image-constructor.html",
|
||||||
|
"url": "/html/semantics/embedded-content/the-img-element/Image-constructor.html"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html",
|
"path": "html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html",
|
||||||
"url": "/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html"
|
"url": "/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html"
|
||||||
|
@ -16253,10 +16265,6 @@
|
||||||
"path": "html/semantics/embedded-content/the-img-element/img.complete.html",
|
"path": "html/semantics/embedded-content/the-img-element/img.complete.html",
|
||||||
"url": "/html/semantics/embedded-content/the-img-element/img.complete.html"
|
"url": "/html/semantics/embedded-content/the-img-element/img.complete.html"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "html/semantics/embedded-content/the-img-element/Image-constructor.html",
|
|
||||||
"url": "/html/semantics/embedded-content/the-img-element/Image-constructor.html"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "html/semantics/embedded-content/the-img-element/relevant-mutations.html",
|
"path": "html/semantics/embedded-content/the-img-element/relevant-mutations.html",
|
||||||
"url": "/html/semantics/embedded-content/the-img-element/relevant-mutations.html"
|
"url": "/html/semantics/embedded-content/the-img-element/relevant-mutations.html"
|
||||||
|
@ -23018,8 +23026,8 @@
|
||||||
"url": "/webaudio/the-audio-api/the-gainnode-interface/idl-test.html"
|
"url": "/webaudio/the-audio-api/the-gainnode-interface/idl-test.html"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "webaudio/the-audio-api/the-gainnode-interface/test.html",
|
"path": "webaudio/the-audio-api/the-gainnode-interface/test-gainnode.html",
|
||||||
"url": "/webaudio/the-audio-api/the-gainnode-interface/test.html"
|
"url": "/webaudio/the-audio-api/the-gainnode-interface/test-gainnode.html"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html",
|
"path": "webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html",
|
||||||
|
@ -24245,6 +24253,14 @@
|
||||||
"path": "webstorage/storage_clear.html",
|
"path": "webstorage/storage_clear.html",
|
||||||
"url": "/webstorage/storage_clear.html"
|
"url": "/webstorage/storage_clear.html"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "webstorage/storage_enumerate.html",
|
||||||
|
"url": "/webstorage/storage_enumerate.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "webstorage/storage_functions_not_overwritten.html",
|
||||||
|
"url": "/webstorage/storage_functions_not_overwritten.html"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "webstorage/storage_getitem.html",
|
"path": "webstorage/storage_getitem.html",
|
||||||
"url": "/webstorage/storage_getitem.html"
|
"url": "/webstorage/storage_getitem.html"
|
||||||
|
@ -24269,10 +24285,26 @@
|
||||||
"path": "webstorage/storage_length.html",
|
"path": "webstorage/storage_length.html",
|
||||||
"url": "/webstorage/storage_length.html"
|
"url": "/webstorage/storage_length.html"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "webstorage/storage_local_window_open.html",
|
||||||
|
"url": "/webstorage/storage_local_window_open.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "webstorage/storage_local_window_open_second.html",
|
||||||
|
"url": "/webstorage/storage_local_window_open_second.html"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "webstorage/storage_removeitem.html",
|
"path": "webstorage/storage_removeitem.html",
|
||||||
"url": "/webstorage/storage_removeitem.html"
|
"url": "/webstorage/storage_removeitem.html"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "webstorage/storage_session_window_open.html",
|
||||||
|
"url": "/webstorage/storage_session_window_open.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "webstorage/storage_session_window_open_second.html",
|
||||||
|
"url": "/webstorage/storage_session_window_open_second.html"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "webstorage/storage_set_value_enumerate.html",
|
"path": "webstorage/storage_set_value_enumerate.html",
|
||||||
"url": "/webstorage/storage_set_value_enumerate.html"
|
"url": "/webstorage/storage_set_value_enumerate.html"
|
||||||
|
@ -24281,6 +24313,10 @@
|
||||||
"path": "webstorage/storage_setitem.html",
|
"path": "webstorage/storage_setitem.html",
|
||||||
"url": "/webstorage/storage_setitem.html"
|
"url": "/webstorage/storage_setitem.html"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "webstorage/storage_string_conversion.html",
|
||||||
|
"url": "/webstorage/storage_string_conversion.html"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "webvtt/interfaces.html",
|
"path": "webvtt/interfaces.html",
|
||||||
"url": "/webvtt/interfaces.html"
|
"url": "/webvtt/interfaces.html"
|
||||||
|
@ -26340,6 +26376,26 @@
|
||||||
"timeout": "long",
|
"timeout": "long",
|
||||||
"url": "/websockets/unload-a-document/005.html"
|
"url": "/websockets/unload-a-document/005.html"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "webstorage/event_basic.html",
|
||||||
|
"timeout": "long",
|
||||||
|
"url": "/webstorage/event_basic.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "webstorage/event_body_attribute.html",
|
||||||
|
"timeout": "long",
|
||||||
|
"url": "/webstorage/event_body_attribute.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "webstorage/event_case_sensitive.html",
|
||||||
|
"timeout": "long",
|
||||||
|
"url": "/webstorage/event_case_sensitive.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "webstorage/event_setattribute.html",
|
||||||
|
"timeout": "long",
|
||||||
|
"url": "/webstorage/event_setattribute.html"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "webstorage/storage_local_setitem_quotaexceedederr.html",
|
"path": "webstorage/storage_local_setitem_quotaexceedederr.html",
|
||||||
"timeout": "long",
|
"timeout": "long",
|
||||||
|
@ -31872,7 +31928,7 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"rev": "4d96cccabc2feacd48e1dab9afc22b8af2225572",
|
"rev": "87398b8448f699e3e324148795891658f2fa16dd",
|
||||||
"url_base": "/",
|
"url_base": "/",
|
||||||
"version": 2
|
"version": 2
|
||||||
}
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
[XMLSerializer-serializeToString.html]
|
||||||
|
type: testharness
|
||||||
|
[check XMLSerializer.serializeToString method could parsing xmldoc to string]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -9015,3 +9015,33 @@
|
||||||
[WebSocket interface: operation send(ArrayBufferView)]
|
[WebSocket interface: operation send(ArrayBufferView)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
[HTMLOptionElement must be primary interface of new Option()]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[Stringification of new Option()]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[HTMLOptionElement interface: new Option() must inherit property "disabled" with the proper type (0)]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[HTMLOptionElement interface: new Option() must inherit property "form" with the proper type (1)]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[HTMLOptionElement interface: new Option() must inherit property "label" with the proper type (2)]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[HTMLOptionElement interface: new Option() must inherit property "defaultSelected" with the proper type (3)]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[HTMLOptionElement interface: new Option() must inherit property "selected" with the proper type (4)]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[HTMLOptionElement interface: new Option() must inherit property "value" with the proper type (5)]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[HTMLOptionElement interface: new Option() must inherit property "text" with the proper type (6)]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[HTMLOptionElement interface: new Option() must inherit property "index" with the proper type (7)]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
d86c5879255ec9ced621412d4565a9a66ee4dc72
|
836463b9e03f441aaf213ff48c99d50d8c1be5a5
|
8
tests/wpt/metadata/webstorage/storage_enumerate.html.ini
Normal file
8
tests/wpt/metadata/webstorage/storage_enumerate.html.ini
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[storage_enumerate.html]
|
||||||
|
type: testharness
|
||||||
|
[localStorage: enumerate a Storage object and get only the keys as a result and the built-in properties of the Storage object should be ignored]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[sessionStorage: enumerate a Storage object and get only the keys as a result and the built-in properties of the Storage object should be ignored]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
[storage_local_window_open.html]
|
||||||
|
type: testharness
|
||||||
|
[A new window to make sure there is a copy of the previous window's localStorage, and that they diverge after a change]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
[storage_local_window_open_second.html]
|
||||||
|
type: testharness
|
||||||
|
[A new window to make sure there is a copy of the previous window's localStorage, and that they diverge after a change]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
[storage_session_window_open.html]
|
||||||
|
type: testharness
|
||||||
|
[A new window to make sure there is a copy of the previous window's sessionStorage, and that they diverge after a change]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
[storage_session_window_open_second.html]
|
||||||
|
type: testharness
|
||||||
|
[A new window to make sure there is a copy of the previous window's sessionStorage, and that they diverge after a change]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
e.target.transaction.abort();
|
e.target.transaction.abort();
|
||||||
|
|
||||||
assert_throws("TransactionInactiveError", function(){
|
assert_throws("InvalidStateError", function(){
|
||||||
index.get("data");
|
index.get("data");
|
||||||
});
|
});
|
||||||
t.done();
|
t.done();
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
e.target.transaction.abort();
|
e.target.transaction.abort();
|
||||||
|
|
||||||
assert_throws("TransactionInactiveError", function(){
|
assert_throws("InvalidStateError", function(){
|
||||||
index.getKey("data");
|
index.getKey("data");
|
||||||
});
|
});
|
||||||
t.done();
|
t.done();
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
e.target.transaction.abort();
|
e.target.transaction.abort();
|
||||||
|
|
||||||
assert_throws("TransactionInactiveError", function(){
|
assert_throws("InvalidStateError", function(){
|
||||||
index.openCursor();
|
index.openCursor();
|
||||||
});
|
});
|
||||||
t.done();
|
t.done();
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
e.target.transaction.abort();
|
e.target.transaction.abort();
|
||||||
|
|
||||||
assert_throws("TransactionInactiveError", function(){
|
assert_throws("InvalidStateError", function(){
|
||||||
index.openKeyCursor();
|
index.openKeyCursor();
|
||||||
});
|
});
|
||||||
t.done();
|
t.done();
|
||||||
|
|
41
tests/wpt/web-platform-tests/WebCryptoAPI/getRandomValues.js
Normal file
41
tests/wpt/web-platform-tests/WebCryptoAPI/getRandomValues.js
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
function run_test() {
|
||||||
|
// Step 1.
|
||||||
|
test(function() {
|
||||||
|
assert_throws("TypeMismatchError", function() {
|
||||||
|
self.crypto.getRandomValues(new Float32Array(6))
|
||||||
|
}, "Float32Array")
|
||||||
|
assert_throws("TypeMismatchError", function() {
|
||||||
|
self.crypto.getRandomValues(new Float64Array(6))
|
||||||
|
}, "Float64Array")
|
||||||
|
|
||||||
|
assert_throws("TypeMismatchError", function() {
|
||||||
|
self.crypto.getRandomValues(new Float32Array(65537))
|
||||||
|
}, "Float32Array (too long)")
|
||||||
|
assert_throws("TypeMismatchError", function() {
|
||||||
|
self.crypto.getRandomValues(new Float64Array(65537))
|
||||||
|
}, "Float64Array (too long)")
|
||||||
|
}, "Float arrays")
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
assert_equals(self.crypto.getRandomValues(new Int8Array(8)).constructor,
|
||||||
|
Int8Array, "crypto.getRandomValues(new Int8Array(8))")
|
||||||
|
assert_equals(self.crypto.getRandomValues(new Uint8Array(8)).constructor,
|
||||||
|
Uint8Array, "crypto.getRandomValues(new Uint8Array(8))")
|
||||||
|
|
||||||
|
assert_equals(self.crypto.getRandomValues(new Int16Array(8)).constructor,
|
||||||
|
Int16Array, "crypto.getRandomValues(new Int16Array(8))")
|
||||||
|
assert_equals(self.crypto.getRandomValues(new Uint16Array(8)).constructor,
|
||||||
|
Uint16Array, "crypto.getRandomValues(new Uint16Array(8))")
|
||||||
|
|
||||||
|
assert_equals(self.crypto.getRandomValues(new Int32Array(8)).constructor,
|
||||||
|
Int32Array, "crypto.getRandomValues(new Int32Array(8))")
|
||||||
|
assert_equals(self.crypto.getRandomValues(new Uint32Array(8)).constructor,
|
||||||
|
Uint32Array, "crypto.getRandomValues(new Uint32Array(8))")
|
||||||
|
}, "Integer arrays")
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
assert_throws("QuotaExceededError", function() {
|
||||||
|
self.crypto.getRandomValues(new Int8Array(65537))
|
||||||
|
}, "crypto.getRandomValues length over 65536")
|
||||||
|
}, "Large length")
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
importScripts("/resources/testharness.js");
|
||||||
|
importScripts("getRandomValues.js");
|
||||||
|
run_test();
|
||||||
|
done();
|
|
@ -5,43 +5,8 @@
|
||||||
<link rel="help" href="https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#dfn-Crypto-method-getRandomValues">
|
<link rel="help" href="https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#dfn-Crypto-method-getRandomValues">
|
||||||
<script src="/resources/testharness.js"></script>
|
<script src="/resources/testharness.js"></script>
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="getRandomValues.js"></script>
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
<script>
|
<script>
|
||||||
// Step 1.
|
run_test();
|
||||||
test(function() {
|
|
||||||
assert_throws("TypeMismatchError", function() {
|
|
||||||
window.crypto.getRandomValues(new Float32Array(6))
|
|
||||||
}, "Float32Array")
|
|
||||||
assert_throws("TypeMismatchError", function() {
|
|
||||||
window.crypto.getRandomValues(new Float64Array(6))
|
|
||||||
}, "Float64Array")
|
|
||||||
|
|
||||||
assert_throws("TypeMismatchError", function() {
|
|
||||||
window.crypto.getRandomValues(new Float32Array(65537))
|
|
||||||
}, "Float32Array (too long)")
|
|
||||||
assert_throws("TypeMismatchError", function() {
|
|
||||||
window.crypto.getRandomValues(new Float64Array(65537))
|
|
||||||
}, "Float64Array (too long)")
|
|
||||||
}, "Float arrays")
|
|
||||||
|
|
||||||
test(function() {
|
|
||||||
assert_equals(window.crypto.getRandomValues(new Int8Array(8)).constructor,
|
|
||||||
Int8Array, "crypto.getRandomValues(new Int8Array(8))")
|
|
||||||
assert_equals(window.crypto.getRandomValues(new Uint8Array(8)).constructor,
|
|
||||||
Uint8Array, "crypto.getRandomValues(new Uint8Array(8))")
|
|
||||||
|
|
||||||
assert_equals(window.crypto.getRandomValues(new Int16Array(8)).constructor,
|
|
||||||
Int16Array, "crypto.getRandomValues(new Int16Array(8))")
|
|
||||||
assert_equals(window.crypto.getRandomValues(new Uint16Array(8)).constructor,
|
|
||||||
Uint16Array, "crypto.getRandomValues(new Uint16Array(8))")
|
|
||||||
|
|
||||||
assert_equals(window.crypto.getRandomValues(new Int32Array(8)).constructor,
|
|
||||||
Int32Array, "crypto.getRandomValues(new Int32Array(8))")
|
|
||||||
assert_equals(window.crypto.getRandomValues(new Uint32Array(8)).constructor,
|
|
||||||
Uint32Array, "crypto.getRandomValues(new Uint32Array(8))")
|
|
||||||
|
|
||||||
assert_throws("QuotaExceededError", function() {
|
|
||||||
window.crypto.getRandomValues(new Int8Array(65537))
|
|
||||||
}, "crypto.getRandomValues length over 65536")
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset=utf-8>
|
|
||||||
<title>tv and (scan: 1)</title>
|
|
||||||
<link href='foo' media='tv and (scan: 1)' rel='stylesheet'>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>tv and (scan: 1)</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset=utf-8>
|
|
||||||
<title>tv and (scan: İNTERLACE)</title>
|
|
||||||
<link href='foo' media='tv and (scan: İNTERLACE)' rel='stylesheet'>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>tv and (scan: İNTERLACE)</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset=utf-8>
|
|
||||||
<title>screen and (device-aspect-ratio: 16px/9pt)</title>
|
|
||||||
<link href='foo' media='screen and (device-aspect-ratio: 16px/9pt)' rel='stylesheet'>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>screen and (device-aspect-ratio: 16px/9pt)</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Check that device-aspect-ratio warns about U+000C before/after slash in value</title>
|
|
||||||
<link href='foo' media='screen and (device-aspect-ratio: 16/9)' rel='stylesheet'><!-- U+000C before & after slash -->
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>screen and (device-aspect-ratio: 16 / 9)</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset=utf-8>
|
|
||||||
<title>tv and (scan: interlace)</title>
|
|
||||||
<link href='foo' media='tv and (scan: interlace)' rel='stylesheet'>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>tv and (scan: interlace)</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Check that device-aspect-ratio allows space, tab, or LF before & after slash</title>
|
|
||||||
<link href='foo' media='screen and (device-aspect-ratio: 16
|
|
||||||
/
|
|
||||||
9)' rel='stylesheet'> <!-- space, tab, or LF before & after slash -->
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>Check that device-aspect-ratio allows space, tab, or LF before & after slash</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1799,8 +1799,8 @@
|
||||||
"html/elements/q/cite/userinfo-username-contains-at-sign-novalid.html": "Bad value \u201chttp://::@c@d:2\u201d for attribute \u201ccite\u201d on element \u201cq\u201d: Bad URL: User or password contains an at symbol (\"@\") not percent-encoded.",
|
"html/elements/q/cite/userinfo-username-contains-at-sign-novalid.html": "Bad value \u201chttp://::@c@d:2\u201d for attribute \u201ccite\u201d on element \u201cq\u201d: Bad URL: User or password contains an at symbol (\"@\") not percent-encoded.",
|
||||||
"html/elements/q/cite/userinfo-username-contains-pile-of-poo-novalid.html": "Bad value \u201chttp://\ud83d\udca9:foo@example.com\u201d for attribute \u201ccite\u201d on element \u201cq\u201d: Bad URL: Illegal character in user or password: not a URL code point.",
|
"html/elements/q/cite/userinfo-username-contains-pile-of-poo-novalid.html": "Bad value \u201chttp://\ud83d\udca9:foo@example.com\u201d for attribute \u201ccite\u201d on element \u201cq\u201d: Bad URL: Illegal character in user or password: not a URL code point.",
|
||||||
"html/elements/q/model-novalid.html": "End tag \u201cp\u201d implied, but there were open elements.",
|
"html/elements/q/model-novalid.html": "End tag \u201cp\u201d implied, but there were open elements.",
|
||||||
"html/elements/ruby/empty-novalid.html": "Element \u201cruby\u201d is missing one or more of the following child elements: [rp, rt].",
|
"html/elements/ruby/empty-novalid.html": "Element \u201cruby\u201d is missing one or more of the following child elements: [rp, rt, rtc].",
|
||||||
"html/elements/ruby/missing-rt-novalid.html": "Element \u201cruby\u201d is missing required child element \u201crt\u201d.",
|
"html/elements/ruby/missing-rt-novalid.html": "Element \u201cruby\u201d is missing one or more of the following child elements: [rt, rtc].",
|
||||||
"html/elements/samp/model-novalid.html": "End tag \u201cp\u201d implied, but there were open elements.",
|
"html/elements/samp/model-novalid.html": "End tag \u201cp\u201d implied, but there were open elements.",
|
||||||
"html/elements/script/language-novalid.html": "The \u201clanguage\u201d attribute on the \u201cscript\u201d element is obsolete. Use the \u201ctype\u201d attribute instead.",
|
"html/elements/script/language-novalid.html": "The \u201clanguage\u201d attribute on the \u201cscript\u201d element is obsolete. Use the \u201ctype\u201d attribute instead.",
|
||||||
"html/elements/script/src-empty-novalid.html": "Bad value \u201c\u201d for attribute \u201csrc\u201d on element \u201cscript\u201d: Bad URL: Must be non-empty.",
|
"html/elements/script/src-empty-novalid.html": "Bad value \u201c\u201d for attribute \u201csrc\u201d on element \u201cscript\u201d: Bad URL: Must be non-empty.",
|
||||||
|
@ -2161,16 +2161,15 @@
|
||||||
"html/media-queries/012-novalid.html": "Bad value \u201cscreen and (min-width: 400px)and (max-width: 600px)\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Expected whitespace but saw \u201ca\u201d instead.",
|
"html/media-queries/012-novalid.html": "Bad value \u201cscreen and (min-width: 400px)and (max-width: 600px)\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Expected whitespace but saw \u201ca\u201d instead.",
|
||||||
"html/media-queries/013-novalid.html": "Bad value \u201cscreen and (min-width:\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Media query ended prematurely.",
|
"html/media-queries/013-novalid.html": "Bad value \u201cscreen and (min-width:\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Media query ended prematurely.",
|
||||||
"html/media-queries/014-novalid.html": "Bad value \u201cscreen and (min-width: 400px) and\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Media query ended prematurely.",
|
"html/media-queries/014-novalid.html": "Bad value \u201cscreen and (min-width: 400px) and\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Media query ended prematurely.",
|
||||||
"html/media-queries/015-novalid.html": "Bad value \u201ctv and (scan: 1)\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Expected a letter but saw \u201c1\u201d instead.",
|
|
||||||
"html/media-queries/016-novalid.html": "Bad value \u201ctv and (scan: \u0130NTERLACE)\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Expected a letter but saw \u201c\u0130\u201d instead.",
|
|
||||||
"html/media-queries/017-novalid.html": "Bad value \u201cscreen and (device-aspect-ratio: 16px/9pt)\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Expected a digit, whitespace or \u201c/\u201d for device-aspect-ratio value but saw \u201cp\u201d instead.",
|
|
||||||
"html/media-queries/018-haswarn.html": "This document is not mappable to XML 1.0 without data loss due to U+000c which is not a legal XML 1.0 character.",
|
|
||||||
"html/media-queries/019-novalid.html": "Bad value \u201cscreen and (color: 1em)\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Expected a digit, whitespace or \u201c)\u201d but saw \u201ce\u201d instead.",
|
"html/media-queries/019-novalid.html": "Bad value \u201cscreen and (color: 1em)\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Expected a digit, whitespace or \u201c)\u201d but saw \u201ce\u201d instead.",
|
||||||
"html/media-queries/020-novalid.html": "Bad value \u201c,\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Media query ended prematurely.",
|
"html/media-queries/020-novalid.html": "Bad value \u201c,\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Media query ended prematurely.",
|
||||||
"html/media-queries/021-novalid.html": "Bad value \u201cscreen,,print\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Media query ended prematurely.",
|
"html/media-queries/021-novalid.html": "Bad value \u201cscreen,,print\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Media query ended prematurely.",
|
||||||
"html/media-queries/022-novalid.html": "Bad value \u201cscreen,\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Media query ended prematurely.",
|
"html/media-queries/022-novalid.html": "Bad value \u201cscreen,\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Media query ended prematurely.",
|
||||||
"html/media-queries/023-novalid.html": "Bad value \u201c,screen\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Media query ended prematurely.",
|
"html/media-queries/023-novalid.html": "Bad value \u201c,screen\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Media query ended prematurely.",
|
||||||
"html/media-queries/024-novalid.html": "Bad value \u201cscreen and (min-width: 400)\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Non-zero lengths require a unit.",
|
"html/media-queries/024-novalid.html": "Bad value \u201cscreen and (min-width: 400)\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Non-zero lengths require a unit.",
|
||||||
|
"html/media-queries/device-aspect-ratio-novalid.html": "Bad value \u201cscreen and (device-aspect-ratio: 16/9)\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Expected a CSS media feature but saw \u201cdevice-aspect-ratio\u201d instead.",
|
||||||
|
"html/media-queries/projection-novalid.html": "Bad value \u201cprojection\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Expected a CSS media type but the query ended.",
|
||||||
|
"html/media-queries/tv-novalid.html": "Bad value \u201ctv and (scan: progressive)\u201d for attribute \u201cmedia\u201d on element \u201clink\u201d: Bad media query: Expected a CSS media type but saw \u201ctv\u201d instead.",
|
||||||
"html/microdata/itemid-scheme-data-contains-fragment-haswarn.html": "Bad value \u201cdata:text/html,test#test\u201d for attribute \u201citemid\u201d on element \u201cdiv\u201d: Bad URL: Fragment is not allowed for data: URIs according to RFC 2397.",
|
"html/microdata/itemid-scheme-data-contains-fragment-haswarn.html": "Bad value \u201cdata:text/html,test#test\u201d for attribute \u201citemid\u201d on element \u201cdiv\u201d: Bad URL: Fragment is not allowed for data: URIs according to RFC 2397.",
|
||||||
"html/microdata/itemid/fragment-backslash-novalid.html": "Bad value \u201c#\\\u201d for attribute \u201citemid\u201d on element \u201cdiv\u201d: Bad URL: Illegal character in fragment: not a URL code point.",
|
"html/microdata/itemid/fragment-backslash-novalid.html": "Bad value \u201c#\\\u201d for attribute \u201citemid\u201d on element \u201cdiv\u201d: Bad URL: Illegal character in fragment: not a URL code point.",
|
||||||
"html/microdata/itemid/fragment-contains-hash-novalid.html": "Bad value \u201chttp://foo/path#f#g\u201d for attribute \u201citemid\u201d on element \u201cdiv\u201d: Bad URL: Illegal character in fragment: not a URL code point.",
|
"html/microdata/itemid/fragment-contains-hash-novalid.html": "Bad value \u201chttp://foo/path#f#g\u201d for attribute \u201citemid\u201d on element \u201cdiv\u201d: Bad URL: Illegal character in fragment: not a URL code point.",
|
||||||
|
@ -2391,8 +2390,8 @@
|
||||||
"xhtml/elements/progress/009-novalid.xhtml": "The value of the \u201cvalue\u201d attribute must be less than or equal to the value of the \u201cmax\u201d attribute.",
|
"xhtml/elements/progress/009-novalid.xhtml": "The value of the \u201cvalue\u201d attribute must be less than or equal to the value of the \u201cmax\u201d attribute.",
|
||||||
"xhtml/elements/progress/108-novalid.xhtml": "The value of the \u201cvalue\u201d attribute must be less than or equal to one when the \u201cmax\u201d attribute is absent.",
|
"xhtml/elements/progress/108-novalid.xhtml": "The value of the \u201cvalue\u201d attribute must be less than or equal to one when the \u201cmax\u201d attribute is absent.",
|
||||||
"xhtml/elements/progress/309-novalid.xhtml": "The value of the \u201cvalue\u201d attribute must be less than or equal to the value of the \u201cmax\u201d attribute.",
|
"xhtml/elements/progress/309-novalid.xhtml": "The value of the \u201cvalue\u201d attribute must be less than or equal to the value of the \u201cmax\u201d attribute.",
|
||||||
"xhtml/elements/ruby/001-novalid.xhtml": "Element \u201cruby\u201d is missing one or more of the following child elements: [rp, rt].",
|
"xhtml/elements/ruby/001-novalid.xhtml": "Element \u201cruby\u201d is missing one or more of the following child elements: [rp, rt, rtc].",
|
||||||
"xhtml/elements/ruby/002-novalid.xhtml": "Element \u201cruby\u201d is missing required child element \u201crt\u201d.",
|
"xhtml/elements/ruby/002-novalid.xhtml": "Element \u201cruby\u201d is missing one or more of the following child elements: [rt, rtc].",
|
||||||
"xhtml/elements/script/001-novalid.xhtml": "The \u201clanguage\u201d attribute on the \u201cscript\u201d element is obsolete. Use the \u201ctype\u201d attribute instead.",
|
"xhtml/elements/script/001-novalid.xhtml": "The \u201clanguage\u201d attribute on the \u201cscript\u201d element is obsolete. Use the \u201ctype\u201d attribute instead.",
|
||||||
"xhtml/elements/table/201-novalid.xhtml": "Table cell spans past the end of its row group established by a \u201ctbody\u201d element; clipped to the end of the row group.",
|
"xhtml/elements/table/201-novalid.xhtml": "Table cell spans past the end of its row group established by a \u201ctbody\u201d element; clipped to the end of the row group.",
|
||||||
"xhtml/elements/table/202-novalid.xhtml": "Table cell is overlapped by later table cell.",
|
"xhtml/elements/table/202-novalid.xhtml": "Table cell is overlapped by later table cell.",
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<title>Check that device-aspect-ratio allows CR before and after slash</title>
|
|
||||||
<link href='foo' media='screen and (device-aspect-ratio: 16
/
9)' rel='stylesheet'/> <!-- CR before & after slash -->
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>Check that device-aspect-ratio allows CR before andafter slash</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>Introduction to Writing Content Security Policy Tests</title>
|
<title>Introduction to Writing Content Security Policy Tests</title>
|
||||||
<link rel="stylesheet" type="text/css" href="README.css"></link>
|
<link rel="stylesheet" type="text/css" href="README.css">
|
||||||
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/styles/default.min.css">
|
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/styles/default.min.css">
|
||||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/highlight.min.js"></script>
|
<script src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/highlight.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<meta charset=utf-8>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>domparsing Test: XMLSerializer.serializeToString</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>domparsing_XMLSerializer_serializeToString</h1>
|
||||||
|
<script>
|
||||||
|
function createXmlDoc(){
|
||||||
|
var input = '<?xml version="1.0" encoding="UTF-8"?><root><child1>value1</child1></root>';
|
||||||
|
var parser = new DOMParser();
|
||||||
|
var doc = parser.parseFromString(input, 'text/xml');
|
||||||
|
return doc;
|
||||||
|
}
|
||||||
|
test(function() {
|
||||||
|
var serializer = new XMLSerializer ();
|
||||||
|
var root = createXmlDoc().documentElement;
|
||||||
|
var xmlString=serializer.serializeToString(root);
|
||||||
|
assert_equals(xmlString, "<root><child1>value1</child1></root>");
|
||||||
|
}, 'check XMLSerializer.serializeToString method could parsing xmldoc to string');
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -3332,7 +3332,7 @@ window.onload = function() {
|
||||||
HTMLSelectElement: ['document.createElement("select")'],
|
HTMLSelectElement: ['document.createElement("select")'],
|
||||||
HTMLDataListElement: ['document.createElement("datalist")'],
|
HTMLDataListElement: ['document.createElement("datalist")'],
|
||||||
HTMLOptGroupElement: ['document.createElement("optgroup")'],
|
HTMLOptGroupElement: ['document.createElement("optgroup")'],
|
||||||
HTMLOptionElement: ['document.createElement("option")'],
|
HTMLOptionElement: ['document.createElement("option")', 'new Option()'],
|
||||||
HTMLTextAreaElement: ['document.createElement("textarea")'],
|
HTMLTextAreaElement: ['document.createElement("textarea")'],
|
||||||
HTMLKeygenElement: ['document.createElement("keygen")'],
|
HTMLKeygenElement: ['document.createElement("keygen")'],
|
||||||
HTMLOutputElement: ['document.createElement("output")'],
|
HTMLOutputElement: ['document.createElement("output")'],
|
||||||
|
|
|
@ -16,7 +16,6 @@ INDENT TABS: content-security-policy/*
|
||||||
INDENT TABS: custom-elements/*
|
INDENT TABS: custom-elements/*
|
||||||
INDENT TABS: DOMEvents/*
|
INDENT TABS: DOMEvents/*
|
||||||
INDENT TABS: html/editing/dnd/*
|
INDENT TABS: html/editing/dnd/*
|
||||||
INDENT TABS: media-source/*
|
|
||||||
INDENT TABS: old-tests/*
|
INDENT TABS: old-tests/*
|
||||||
INDENT TABS: pointerlock/*
|
INDENT TABS: pointerlock/*
|
||||||
INDENT TABS: shadow-dom/*
|
INDENT TABS: shadow-dom/*
|
||||||
|
@ -36,7 +35,6 @@ TRAILING WHITESPACE: content-security-policy/*
|
||||||
TRAILING WHITESPACE: custom-elements/*
|
TRAILING WHITESPACE: custom-elements/*
|
||||||
TRAILING WHITESPACE: DOMEvents/*
|
TRAILING WHITESPACE: DOMEvents/*
|
||||||
TRAILING WHITESPACE: html-longdesc/*
|
TRAILING WHITESPACE: html-longdesc/*
|
||||||
TRAILING WHITESPACE: media-source/*
|
|
||||||
TRAILING WHITESPACE: microdata/*
|
TRAILING WHITESPACE: microdata/*
|
||||||
TRAILING WHITESPACE: old-tests/*
|
TRAILING WHITESPACE: old-tests/*
|
||||||
TRAILING WHITESPACE: pointerevents/*
|
TRAILING WHITESPACE: pointerevents/*
|
||||||
|
|
|
@ -9,14 +9,51 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
<script>
|
<script>
|
||||||
var video = document.createElement('video');
|
async_test(function(t) {
|
||||||
test(function() {
|
|
||||||
var mediaSource = new MediaSource();
|
var mediaSource = new MediaSource();
|
||||||
var url = window.URL.createObjectURL(mediaSource);
|
var url = window.URL.createObjectURL(mediaSource);
|
||||||
window.URL.revokeObjectURL(url);
|
window.URL.revokeObjectURL(url);
|
||||||
|
mediaSource.addEventListener('sourceopen',
|
||||||
|
t.unreached_func("url should not reference MediaSource."));
|
||||||
|
var video = document.createElement('video');
|
||||||
video.src = url;
|
video.src = url;
|
||||||
|
video.addEventListener('error', t.step_func_done(function(e) {
|
||||||
|
assert_equals(e.target.error.code,
|
||||||
|
MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED,
|
||||||
|
'Expected error code');
|
||||||
assert_equals(mediaSource.readyState, 'closed');
|
assert_equals(mediaSource.readyState, 'closed');
|
||||||
|
}));
|
||||||
}, "Check revoking behavior of URL.revokeObjectURL(url).");
|
}, "Check revoking behavior of URL.revokeObjectURL(url).");
|
||||||
|
async_test(function(t) {
|
||||||
|
var mediaSource = new MediaSource();
|
||||||
|
var url = window.URL.createObjectURL(mediaSource);
|
||||||
|
var video = document.createElement('video');
|
||||||
|
var unexpectedErrorHandler = t.unreached_func("Unexpected error.")
|
||||||
|
video.addEventListener('error', unexpectedErrorHandler);
|
||||||
|
video.src = url;
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
mediaSource.addEventListener('sourceopen', t.step_func_done(function(e) {
|
||||||
|
assert_equals(mediaSource.readyState, 'open');
|
||||||
|
mediaSource.endOfStream();
|
||||||
|
video.removeEventListener('error', unexpectedErrorHandler);
|
||||||
|
}));
|
||||||
|
}, "Check referenced MediaSource can open after URL.revokeObjectURL(url).");
|
||||||
|
async_test(function(t) {
|
||||||
|
var mediaSource = new MediaSource();
|
||||||
|
var url = window.URL.createObjectURL(mediaSource);
|
||||||
|
setTimeout(function() {
|
||||||
|
mediaSource.addEventListener('sourceopen',
|
||||||
|
t.unreached_func("url should not reference MediaSource."));
|
||||||
|
var video = document.createElement('video');
|
||||||
|
video.src = url;
|
||||||
|
video.addEventListener('error', t.step_func_done(function(e) {
|
||||||
|
assert_equals(e.target.error.code,
|
||||||
|
MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED,
|
||||||
|
'Expected error code');
|
||||||
|
assert_equals(mediaSource.readyState, 'closed');
|
||||||
|
}));
|
||||||
|
}, 0);
|
||||||
|
}, "Check auto-revoking behavior with URL.createObjectURL(MediaSource).");
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,93 +0,0 @@
|
||||||
<!doctype html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel='stylesheet' href='/resources/testharness.css'>
|
|
||||||
<script>
|
|
||||||
(function() {
|
|
||||||
var testURLs = [];
|
|
||||||
var testIndex = 0;
|
|
||||||
var testCount = 0;
|
|
||||||
var STATUS_STRINGS = ["PASS", "FAIL", "TIMEOUT", "NOTRUN"];
|
|
||||||
|
|
||||||
function onMessage(e)
|
|
||||||
{
|
|
||||||
var testData = e.data;
|
|
||||||
|
|
||||||
//console.log(testData.type, testData);
|
|
||||||
|
|
||||||
if (testData.type == "complete") {
|
|
||||||
var tableBody = document.querySelector("#results tbody");
|
|
||||||
var fragment = document.createDocumentFragment();
|
|
||||||
|
|
||||||
testCount += testData.tests.length;
|
|
||||||
|
|
||||||
for (var i = 0; i < testData.tests.length; ++i) {
|
|
||||||
var testResults = testData.tests[i];
|
|
||||||
var tr = document.createElement("tr");
|
|
||||||
var status = document.createElement("td");
|
|
||||||
var testName = document.createElement("td");
|
|
||||||
var message = document.createElement("td");
|
|
||||||
|
|
||||||
status.textContent = STATUS_STRINGS[testResults.status];
|
|
||||||
tr.className = STATUS_STRINGS[testResults.status].toLowerCase();
|
|
||||||
|
|
||||||
testName.textContent = testResults.name;
|
|
||||||
message.textContent = testResults.message;
|
|
||||||
|
|
||||||
tr.appendChild(status);
|
|
||||||
tr.appendChild(testName);
|
|
||||||
tr.appendChild(message);
|
|
||||||
fragment.appendChild(tr);
|
|
||||||
}
|
|
||||||
|
|
||||||
testIndex++;
|
|
||||||
if (testIndex >= testURLs.length) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
tableBody.appendChild(fragment);
|
|
||||||
startNextTest();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function startNextTest()
|
|
||||||
{
|
|
||||||
var iframe = document.querySelector("iframe");
|
|
||||||
var testURL = testURLs[testIndex];
|
|
||||||
|
|
||||||
var tr = document.createElement("tr");
|
|
||||||
var td = document.createElement("td");
|
|
||||||
td.appendChild(document.createTextNode("Running tests in '" + testURL + "' :"));
|
|
||||||
td.colSpan = 3;
|
|
||||||
tr.appendChild(td);
|
|
||||||
document.querySelector("#results tbody").appendChild(tr);
|
|
||||||
|
|
||||||
iframe.src = testURL;
|
|
||||||
}
|
|
||||||
|
|
||||||
window["onBodyLoad"] = function()
|
|
||||||
{
|
|
||||||
window.addEventListener("message", onMessage);
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.open("GET", "manifest.txt", false);
|
|
||||||
xhr.send();
|
|
||||||
|
|
||||||
var str = xhr.response.replace("\r", "");
|
|
||||||
testURLs = xhr.response.replace("\r", "").split("\n");
|
|
||||||
startNextTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
})(window);
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body onload="onBodyLoad()">
|
|
||||||
<iframe></iframe>
|
|
||||||
<table id="results" style="float:left;">
|
|
||||||
<tbody>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -11,7 +11,7 @@
|
||||||
<script>
|
<script>
|
||||||
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
||||||
{
|
{
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
|
|
||||||
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
||||||
test.expectEvent(sourceBuffer, "update", "Append success.");
|
test.expectEvent(sourceBuffer, "update", "Append success.");
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
||||||
{
|
{
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
|
|
||||||
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
||||||
test.expectEvent(sourceBuffer, "update", "Append success.");
|
test.expectEvent(sourceBuffer, "update", "Append success.");
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
||||||
{
|
{
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
|
|
||||||
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
||||||
test.expectEvent(sourceBuffer, "abort", "Append aborted.");
|
test.expectEvent(sourceBuffer, "abort", "Append aborted.");
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
|
|
||||||
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
||||||
{
|
{
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
|
|
||||||
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
||||||
test.expectEvent(sourceBuffer, "update", "Append success.");
|
test.expectEvent(sourceBuffer, "update", "Append success.");
|
||||||
|
@ -155,7 +155,7 @@
|
||||||
|
|
||||||
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
||||||
{
|
{
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
|
|
||||||
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
||||||
test.expectEvent(sourceBuffer, "abort", "Append aborted.");
|
test.expectEvent(sourceBuffer, "abort", "Append aborted.");
|
||||||
|
@ -183,7 +183,7 @@
|
||||||
|
|
||||||
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
||||||
{
|
{
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
|
|
||||||
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
||||||
test.expectEvent(sourceBuffer, "updateend", "Append ended.");
|
test.expectEvent(sourceBuffer, "updateend", "Append ended.");
|
||||||
|
@ -204,8 +204,8 @@
|
||||||
|
|
||||||
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
||||||
{
|
{
|
||||||
test.failOnEvent(mediaElement, "error");
|
mediaElement.addEventListener("error", test.unreached_func("Unexpected event 'error'"));
|
||||||
test.failOnEvent(mediaSource, "sourceended");
|
mediaSource.addEventListener("sourceended", test.unreached_func("Unexpected event 'sourceended'"));
|
||||||
|
|
||||||
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
||||||
test.expectEvent(sourceBuffer, "updateend", "Append ended.");
|
test.expectEvent(sourceBuffer, "updateend", "Append ended.");
|
||||||
|
@ -229,7 +229,7 @@
|
||||||
|
|
||||||
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
||||||
{
|
{
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
|
|
||||||
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
test.expectEvent(sourceBuffer, "updatestart", "Append started.");
|
||||||
test.expectEvent(sourceBuffer, "updateend", "Append ended.");
|
test.expectEvent(sourceBuffer, "updateend", "Append ended.");
|
||||||
|
|
|
@ -29,8 +29,8 @@
|
||||||
mediasource_test(function(test, mediaElement, mediaSource)
|
mediasource_test(function(test, mediaElement, mediaSource)
|
||||||
{
|
{
|
||||||
mediaElement.pause();
|
mediaElement.pause();
|
||||||
test.failOnEvent(mediaElement, "error");
|
mediaElement.addEventListener("error", test.unreached_func("Unexpected event 'error'"));
|
||||||
test.endOnEvent(mediaElement, "ended");
|
mediaElement.addEventListener("ended", test.step_func_done());
|
||||||
|
|
||||||
MediaSourceUtil.fetchManifestAndData(test, manifestFilenameA, function(typeA, dataA)
|
MediaSourceUtil.fetchManifestAndData(test, manifestFilenameA, function(typeA, dataA)
|
||||||
{
|
{
|
||||||
|
@ -86,8 +86,8 @@
|
||||||
mediasource_test(function(test, mediaElement, mediaSource)
|
mediasource_test(function(test, mediaElement, mediaSource)
|
||||||
{
|
{
|
||||||
mediaElement.pause();
|
mediaElement.pause();
|
||||||
test.failOnEvent(mediaElement, "error");
|
mediaElement.addEventListener("error", test.unreached_func("Unexpected event 'error'"));
|
||||||
test.endOnEvent(mediaElement, "ended");
|
mediaElement.addEventListener("ended", test.step_func_done());
|
||||||
|
|
||||||
MediaSourceUtil.fetchManifestAndData(test, subType + "/test-av-384k-44100Hz-1ch-320x240-30fps-10kfr-manifest.json", function(type, data)
|
MediaSourceUtil.fetchManifestAndData(test, subType + "/test-av-384k-44100Hz-1ch-320x240-30fps-10kfr-manifest.json", function(type, data)
|
||||||
{
|
{
|
||||||
|
@ -144,8 +144,8 @@
|
||||||
mediasource_test(function(test, mediaElement, mediaSource)
|
mediasource_test(function(test, mediaElement, mediaSource)
|
||||||
{
|
{
|
||||||
mediaElement.pause();
|
mediaElement.pause();
|
||||||
test.failOnEvent(mediaElement, "error");
|
mediaElement.addEventListener("error", test.unreached_func("Unexpected event 'error'"));
|
||||||
test.endOnEvent(mediaElement, "ended");
|
mediaElement.addEventListener("ended", test.step_func_done());
|
||||||
|
|
||||||
MediaSourceUtil.fetchManifestAndData(test, subType + "/test-av-384k-44100Hz-1ch-320x240-30fps-10kfr-manifest.json", function(type, data)
|
MediaSourceUtil.fetchManifestAndData(test, subType + "/test-av-384k-44100Hz-1ch-320x240-30fps-10kfr-manifest.json", function(type, data)
|
||||||
{
|
{
|
||||||
|
@ -173,8 +173,8 @@
|
||||||
mediasource_test(function(test, mediaElement, mediaSource)
|
mediasource_test(function(test, mediaElement, mediaSource)
|
||||||
{
|
{
|
||||||
mediaElement.pause();
|
mediaElement.pause();
|
||||||
test.failOnEvent(mediaElement, "error");
|
mediaElement.addEventListener("error", test.unreached_func("Unexpected event 'error'"));
|
||||||
test.endOnEvent(mediaElement, "ended");
|
mediaElement.addEventListener("ended", test.step_func_done());
|
||||||
|
|
||||||
var sourceBuffer = mediaSource.addSourceBuffer(MediaSourceUtil.AUDIO_ONLY_TYPE);
|
var sourceBuffer = mediaSource.addSourceBuffer(MediaSourceUtil.AUDIO_ONLY_TYPE);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ function mediaSourceConfigChangeTest(directory, idA, idB, description)
|
||||||
mediasource_test(function(test, mediaElement, mediaSource)
|
mediasource_test(function(test, mediaElement, mediaSource)
|
||||||
{
|
{
|
||||||
mediaElement.pause();
|
mediaElement.pause();
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
var expectResizeEvents = resolutionFromFilename(manifestFilenameA) != resolutionFromFilename(manifestFilenameB);
|
var expectResizeEvents = resolutionFromFilename(manifestFilenameA) != resolutionFromFilename(manifestFilenameB);
|
||||||
var expectedResizeEventCount = 0;
|
var expectedResizeEventCount = 0;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<script>
|
<script>
|
||||||
mediasource_test(function(test, mediaElement, mediaSource)
|
mediasource_test(function(test, mediaElement, mediaSource)
|
||||||
{
|
{
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
assert_equals(mediaSource.readyState, 'open');
|
assert_equals(mediaSource.readyState, 'open');
|
||||||
|
|
||||||
assert_throws(new TypeError(),
|
assert_throws(new TypeError(),
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
mediasource_test(function(test, mediaElement, mediaSource)
|
mediasource_test(function(test, mediaElement, mediaSource)
|
||||||
{
|
{
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
assert_equals(mediaSource.readyState, 'open');
|
assert_equals(mediaSource.readyState, 'open');
|
||||||
|
|
||||||
assert_throws(new TypeError(),
|
assert_throws(new TypeError(),
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
mediasource_test(function(test, mediaElement, mediaSource)
|
mediasource_test(function(test, mediaElement, mediaSource)
|
||||||
{
|
{
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
assert_equals(mediaSource.readyState, 'open');
|
assert_equals(mediaSource.readyState, 'open');
|
||||||
|
|
||||||
assert_throws(new TypeError(),
|
assert_throws(new TypeError(),
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
timeUpdateCount++;
|
timeUpdateCount++;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
|
|
||||||
test.expectEvent(sourceBuffer, 'updatestart', 'sourceBuffer');
|
test.expectEvent(sourceBuffer, 'updatestart', 'sourceBuffer');
|
||||||
test.expectEvent(sourceBuffer, 'update', 'sourceBuffer');
|
test.expectEvent(sourceBuffer, 'update', 'sourceBuffer');
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
<script>
|
<script>
|
||||||
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
||||||
{
|
{
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
test.endOnEvent(mediaElement, 'ended');
|
mediaElement.addEventListener('ended', test.step_func_done());
|
||||||
|
|
||||||
test.expectEvent(sourceBuffer, 'updatestart', 'sourceBuffer');
|
test.expectEvent(sourceBuffer, 'updatestart', 'sourceBuffer');
|
||||||
test.expectEvent(sourceBuffer, 'update', 'sourceBuffer');
|
test.expectEvent(sourceBuffer, 'update', 'sourceBuffer');
|
||||||
|
|
|
@ -49,8 +49,8 @@
|
||||||
test.waitForExpectedEvents(function()
|
test.waitForExpectedEvents(function()
|
||||||
{
|
{
|
||||||
// No more seeking or seeked events should occur.
|
// No more seeking or seeked events should occur.
|
||||||
test.failOnEvent(mediaElement, 'seeking');
|
mediaElement.addEventListener('seeking', test.unreached_func("Unexpected event 'seeking'"));
|
||||||
test.failOnEvent(mediaElement, 'seeked');
|
mediaElement.addEventListener('seeked', test.unreached_func("Unexpected event 'seeked'"));
|
||||||
|
|
||||||
assert_false(mediaElement.seeking, 'Element is not seeking');
|
assert_false(mediaElement.seeking, 'Element is not seeking');
|
||||||
assert_greater_than_equal(mediaElement.currentTime, 1.0, 'Element time is at or after last seek time');
|
assert_greater_than_equal(mediaElement.currentTime, 1.0, 'Element time is at or after last seek time');
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
return mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
return mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
||||||
{
|
{
|
||||||
assert_greater_than(segmentInfo.media.length, 3, "at least 3 media segments for supported type");
|
assert_greater_than(segmentInfo.media.length, 3, "at least 3 media segments for supported type");
|
||||||
test.failOnEvent(mediaElement, "error");
|
mediaElement.addEventListener("error", test.unreached_func("Unexpected event 'error'"));
|
||||||
sourceBuffer.mode = "sequence";
|
sourceBuffer.mode = "sequence";
|
||||||
assert_equals(sourceBuffer.mode, "sequence", "mode after setting it to \"sequence\"");
|
assert_equals(sourceBuffer.mode, "sequence", "mode after setting it to \"sequence\"");
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,7 @@
|
||||||
}
|
}
|
||||||
sourceBuffer.addEventListener("update", onUpdate);
|
sourceBuffer.addEventListener("update", onUpdate);
|
||||||
|
|
||||||
test.failOnEvent(sourceBuffer, "error");
|
sourceBuffer.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
|
|
||||||
sourceBuffer.appendBuffer(data);
|
sourceBuffer.appendBuffer(data);
|
||||||
};
|
};
|
||||||
|
@ -308,19 +308,6 @@
|
||||||
|
|
||||||
function addExtraTestMethods(test)
|
function addExtraTestMethods(test)
|
||||||
{
|
{
|
||||||
test.failOnEvent = function(object, eventName)
|
|
||||||
{
|
|
||||||
object.addEventListener(eventName, test.step_func(function(event)
|
|
||||||
{
|
|
||||||
assert_unreached("Unexpected event '" + eventName + "'");
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
test.endOnEvent = function(object, eventName)
|
|
||||||
{
|
|
||||||
object.addEventListener(eventName, test.step_func(function(event) { test.done(); }));
|
|
||||||
};
|
|
||||||
|
|
||||||
test.eventExpectations_ = new EventExpectationsManager(test);
|
test.eventExpectations_ = new EventExpectationsManager(test);
|
||||||
test.expectEvent = function(object, eventName, description)
|
test.expectEvent = function(object, eventName, description)
|
||||||
{
|
{
|
||||||
|
@ -401,7 +388,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
test.failOnEvent(mediaElement, 'error');
|
mediaElement.addEventListener('error', test.unreached_func("Unexpected event 'error'"));
|
||||||
|
|
||||||
var sourceBuffer = mediaSource.addSourceBuffer(segmentInfo.type);
|
var sourceBuffer = mediaSource.addSourceBuffer(segmentInfo.type);
|
||||||
MediaSourceUtil.loadBinaryData(test, segmentInfo.url, function(mediaData)
|
MediaSourceUtil.loadBinaryData(test, segmentInfo.url, function(mediaData)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
<script>
|
<script>
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws("new TypeError()", function() {
|
assert_throws(new TypeError(), function() {
|
||||||
var notification = new Notification();
|
var notification = new Notification();
|
||||||
});
|
});
|
||||||
}, "Test checks that notification constructor arguments can't be empty");
|
}, "Test checks that notification constructor arguments can't be empty");
|
||||||
|
|
|
@ -151,9 +151,6 @@ function resource_load(expected)
|
||||||
t["simple_attrs"].step(function() {
|
t["simple_attrs"].step(function() {
|
||||||
var actual = window.performance.getEntriesByName(expected.name)[0];
|
var actual = window.performance.getEntriesByName(expected.name)[0];
|
||||||
var expected_type = expected.initiatorType;
|
var expected_type = expected.initiatorType;
|
||||||
if (expected.initiatorType == "iframe") {
|
|
||||||
expected_type = "subdocument";
|
|
||||||
}
|
|
||||||
assert_equals(actual.name, expected.name);
|
assert_equals(actual.name, expected.name);
|
||||||
assert_equals(actual.initiatorType, expected_type);
|
assert_equals(actual.initiatorType, expected_type);
|
||||||
assert_equals(actual.entryType, "resource");
|
assert_equals(actual.entryType, "resource");
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
from tools.serve import serve
|
from tools.serve import serve
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
Access-Control-Allow-Origin: http://{{domains[]}}:{{ports[http][0]}}
|
Access-Control-Allow-Origin: {{location[scheme]}}://{{domains[]}}:{{location[port]}}
|
||||||
Access-Control-Allow-Credentials: true
|
Access-Control-Allow-Credentials: true
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
Access-Control-Allow-Origin: http://{{domains[]}}:{{ports[http][0]}}
|
Access-Control-Allow-Origin: {{location[scheme]}}://{{domains[]}}:{{location[port]}}
|
||||||
Access-Control-Allow-Credentials: true
|
Access-Control-Allow-Credentials: true
|
||||||
|
|
30
tests/wpt/web-platform-tests/tools/LICENSE
Normal file
30
tests/wpt/web-platform-tests/tools/LICENSE
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
W3C 3-clause BSD License
|
||||||
|
|
||||||
|
http://www.w3.org/Consortium/Legal/2008/03-bsd-license.html
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of works must retain the original copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the original copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the W3C nor the names of its contributors may be
|
||||||
|
used to endorse or promote products derived from this work without
|
||||||
|
specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -165,16 +165,16 @@ def check_parsed(path, f):
|
||||||
if source_file.testharness_nodes:
|
if source_file.testharness_nodes:
|
||||||
if len(source_file.testharness_nodes) > 1:
|
if len(source_file.testharness_nodes) > 1:
|
||||||
errors.append(("MULTIPLE-TESTHARNESS",
|
errors.append(("MULTIPLE-TESTHARNESS",
|
||||||
"%s more than one <script src='/resources/testharness.js>'" % path, None))
|
"%s more than one <script src='/resources/testharness.js'>" % path, None))
|
||||||
|
|
||||||
testharnessreport_nodes = source_file.root.findall(".//{http://www.w3.org/1999/xhtml}script[@src='/resources/testharnessreport.js']")
|
testharnessreport_nodes = source_file.root.findall(".//{http://www.w3.org/1999/xhtml}script[@src='/resources/testharnessreport.js']")
|
||||||
if not testharnessreport_nodes:
|
if not testharnessreport_nodes:
|
||||||
errors.append(("MISSING-TESTHARNESSREPORT",
|
errors.append(("MISSING-TESTHARNESSREPORT",
|
||||||
"%s missing <script src='/resources/testharnessreport.js>'" % path, None))
|
"%s missing <script src='/resources/testharnessreport.js'>" % path, None))
|
||||||
else:
|
else:
|
||||||
if len(testharnessreport_nodes) > 1:
|
if len(testharnessreport_nodes) > 1:
|
||||||
errors.append(("MULTIPLE-TESTHARNESSREPORT",
|
errors.append(("MULTIPLE-TESTHARNESSREPORT",
|
||||||
"%s more than one <script src='/resources/testharnessreport.js>'" % path, None))
|
"%s more than one <script src='/resources/testharnessreport.js'>" % path, None))
|
||||||
|
|
||||||
for element in source_file.variant_nodes:
|
for element in source_file.variant_nodes:
|
||||||
if "content" not in element.attrib:
|
if "content" not in element.attrib:
|
||||||
|
@ -232,27 +232,46 @@ def output_error_count(error_count):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
error_count = defaultdict(int)
|
error_count = defaultdict(int)
|
||||||
|
last = None
|
||||||
|
|
||||||
def run_lint(path, fn, *args):
|
def run_lint(path, fn, last, *args):
|
||||||
errors = whitelist_errors(path, fn(path, *args))
|
errors = whitelist_errors(path, fn(path, *args))
|
||||||
|
if errors:
|
||||||
|
last = (errors[-1][0], path)
|
||||||
|
|
||||||
output_errors(errors)
|
output_errors(errors)
|
||||||
for error_type, error, line in errors:
|
for error_type, error, line in errors:
|
||||||
error_count[error_type] += 1
|
error_count[error_type] += 1
|
||||||
|
return last
|
||||||
|
|
||||||
for path in iter_files():
|
for path in iter_files():
|
||||||
abs_path = os.path.join(repo_root, path)
|
abs_path = os.path.join(repo_root, path)
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
continue
|
continue
|
||||||
for path_fn in path_lints:
|
for path_fn in path_lints:
|
||||||
run_lint(path, path_fn)
|
last = run_lint(path, path_fn, last)
|
||||||
|
|
||||||
if not os.path.isdir(abs_path):
|
if not os.path.isdir(abs_path):
|
||||||
with open(abs_path) as f:
|
with open(abs_path) as f:
|
||||||
for file_fn in file_lints:
|
for file_fn in file_lints:
|
||||||
run_lint(path, file_fn, f)
|
last = run_lint(path, file_fn, last, f)
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
|
|
||||||
output_error_count(error_count)
|
output_error_count(error_count)
|
||||||
|
if error_count:
|
||||||
|
print
|
||||||
|
print "You must fix all errors; for details on how to fix them, see"
|
||||||
|
print "https://github.com/w3c/web-platform-tests/blob/master/docs/lint-tool.md"
|
||||||
|
print
|
||||||
|
print "However, instead of fixing a particular error, it's sometimes"
|
||||||
|
print "OK to add a line to the lint.whitelist file in the root of the"
|
||||||
|
print "web-platform-tests directory to make the lint tool ignore it."
|
||||||
|
print
|
||||||
|
print "For example, to make the lint tool ignore all '%s'" % last[0]
|
||||||
|
print "errors in the %s file," % last[1]
|
||||||
|
print "you could add the following line to the lint.whitelist file."
|
||||||
|
print
|
||||||
|
print "%s:%s" % (last[0], last[1])
|
||||||
return sum(error_count.itervalues())
|
return sum(error_count.itervalues())
|
||||||
|
|
||||||
path_lints = [check_path_length]
|
path_lints = [check_path_length]
|
||||||
|
|
|
@ -30,7 +30,7 @@ interface URLUtils {
|
||||||
attribute ScalarValueString port;
|
attribute ScalarValueString port;
|
||||||
attribute ScalarValueString pathname;
|
attribute ScalarValueString pathname;
|
||||||
attribute ScalarValueString search;
|
attribute ScalarValueString search;
|
||||||
attribute URLSearchParams searchParams;
|
readonly attribute URLSearchParams searchParams;
|
||||||
attribute ScalarValueString hash;
|
attribute ScalarValueString hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
53
tests/wpt/web-platform-tests/webstorage/eventTestHarness.js
Normal file
53
tests/wpt/web-platform-tests/webstorage/eventTestHarness.js
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
iframe = document.createElement("IFRAME");
|
||||||
|
iframe.src = "about:blank";
|
||||||
|
document.body.appendChild(iframe);
|
||||||
|
iframe.contentWindow.document.body.innerText = "Nothing to see here.";
|
||||||
|
|
||||||
|
storageEventList = new Array();
|
||||||
|
iframe.contentWindow.onstorage = function (e) {
|
||||||
|
window.parent.storageEventList.push(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
function runAfterNStorageEvents(callback, expectedNumEvents)
|
||||||
|
{
|
||||||
|
countStorageEvents(callback, expectedNumEvents, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function countStorageEvents(callback, expectedNumEvents, times)
|
||||||
|
{
|
||||||
|
function onTimeout()
|
||||||
|
{
|
||||||
|
var currentCount = storageEventList.length;
|
||||||
|
if (currentCount == expectedNumEvents) {
|
||||||
|
callback();
|
||||||
|
} else if (currentCount > expectedNumEvents) {
|
||||||
|
msg = "got at least " + currentCount + ", expected only " + expectedNumEvents + " events";
|
||||||
|
callback(msg);
|
||||||
|
} else if (times > 50) {
|
||||||
|
msg = "Timeout: only got " + currentCount + ", expected " + expectedNumEvents + " events";
|
||||||
|
callback(msg);
|
||||||
|
} else {
|
||||||
|
countStorageEvents(callback, expectedNumEvents, times+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setTimeout(onTimeout, 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
function testStorages(testCallback)
|
||||||
|
{
|
||||||
|
// When we're done testing LocalStorage, this is run.
|
||||||
|
function allDone()
|
||||||
|
{
|
||||||
|
localStorage.clear();
|
||||||
|
sessionStorage.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// When we're done testing with SessionStorage, this is run.
|
||||||
|
function runLocalStorage()
|
||||||
|
{
|
||||||
|
testCallback("localStorage", allDone);
|
||||||
|
}
|
||||||
|
|
||||||
|
// First run the test with SessionStorage.
|
||||||
|
testCallback("sessionStorage", runLocalStorage);
|
||||||
|
}
|
15
tests/wpt/web-platform-tests/webstorage/event_basic.html
Normal file
15
tests/wpt/web-platform-tests/webstorage/event_basic.html
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta name="timeout" content="long">
|
||||||
|
<title>WebStorage Test: StorageEvent - window.onstorage</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="log"></div>
|
||||||
|
<script src="eventTestHarness.js"></script>
|
||||||
|
<script src="event_basic.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
148
tests/wpt/web-platform-tests/webstorage/event_basic.js
Normal file
148
tests/wpt/web-platform-tests/webstorage/event_basic.js
Normal file
|
@ -0,0 +1,148 @@
|
||||||
|
test(function() {
|
||||||
|
var name ;
|
||||||
|
testStorages(runTest);
|
||||||
|
|
||||||
|
function runTest(storageString, callback)
|
||||||
|
{
|
||||||
|
name = storageString;
|
||||||
|
window.completionCallback = callback;
|
||||||
|
|
||||||
|
assert_true(storageString in window, storageString + " exist");
|
||||||
|
window.storage = eval(storageString);
|
||||||
|
|
||||||
|
storageEventList = new Array();
|
||||||
|
storage.clear();
|
||||||
|
assert_equals(storage.length, 0, "storage.length");
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step1(msg)
|
||||||
|
{
|
||||||
|
storageEventList = new Array();
|
||||||
|
storage.setItem('FOO', 'BAR');
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function shouldBeEqualToString(express, expectValue) {
|
||||||
|
assert_equals(typeof express, "string");
|
||||||
|
assert_equals(express, expectValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step2(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 1);
|
||||||
|
shouldBeEqualToString(storageEventList[0].key, "FOO");
|
||||||
|
assert_equals(storageEventList[0].oldValue, null);
|
||||||
|
shouldBeEqualToString(storageEventList[0].newValue, "BAR");
|
||||||
|
}, name + ": the first storage event properties");
|
||||||
|
|
||||||
|
storage.setItem('FU', 'BAR');
|
||||||
|
storage.setItem('a', '1');
|
||||||
|
storage.setItem('b', '2');
|
||||||
|
storage.setItem('b', '3');
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step3, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step3(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 5);
|
||||||
|
shouldBeEqualToString(storageEventList[1].key, "FU");
|
||||||
|
assert_equals(storageEventList[1].oldValue, null);
|
||||||
|
shouldBeEqualToString(storageEventList[1].newValue, "BAR");
|
||||||
|
}, name + ": the second storage event properties");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
shouldBeEqualToString(storageEventList[2].key, "a");
|
||||||
|
assert_equals(storageEventList[2].oldValue, null);
|
||||||
|
shouldBeEqualToString(storageEventList[2].newValue, "1");
|
||||||
|
}, name + ": the third storage event properties");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
shouldBeEqualToString(storageEventList[3].key, "b");
|
||||||
|
assert_equals(storageEventList[3].oldValue, null);
|
||||||
|
shouldBeEqualToString(storageEventList[3].newValue, "2");
|
||||||
|
}, name + ": the fourth storage event properties");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
shouldBeEqualToString(storageEventList[4].key, "b");
|
||||||
|
shouldBeEqualToString(storageEventList[4].oldValue, "2");
|
||||||
|
shouldBeEqualToString(storageEventList[4].newValue, "3");
|
||||||
|
}, name + ": the fifth storage event properties");
|
||||||
|
|
||||||
|
|
||||||
|
storage.removeItem('FOO');
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step4, 6);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step4(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 6);
|
||||||
|
shouldBeEqualToString(storageEventList[5].key, "FOO");
|
||||||
|
shouldBeEqualToString(storageEventList[5].oldValue, "BAR");
|
||||||
|
assert_equals(storageEventList[5].newValue, null);
|
||||||
|
}, name + ": the sixth storage event properties");
|
||||||
|
|
||||||
|
storage.removeItem('FU');
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step5, 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step5(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 7);
|
||||||
|
shouldBeEqualToString(storageEventList[6].key, "FU");
|
||||||
|
shouldBeEqualToString(storageEventList[6].oldValue, "BAR");
|
||||||
|
assert_equals(storageEventList[6].newValue, null);
|
||||||
|
}, name + ": the seventh storage event properties");
|
||||||
|
|
||||||
|
storage.clear();
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step6, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step6(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 8);
|
||||||
|
assert_equals(storageEventList[7].key, null);
|
||||||
|
assert_equals(storageEventList[7].oldValue, null);
|
||||||
|
assert_equals(storageEventList[7].newValue, null);
|
||||||
|
}, name + ": the eighth storage event properties");
|
||||||
|
|
||||||
|
completionCallback();
|
||||||
|
}
|
||||||
|
|
||||||
|
}, "DOM Storage mutations fire StorageEvents that are caught by the event listener set via window.onstorage.");
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta name="timeout" content="long">
|
||||||
|
<title>WebStorage Test: StorageEvent - set onstorage as body attribute</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="log"></div>
|
||||||
|
<script src="eventTestHarness.js"></script>
|
||||||
|
<script src="event_body_attribute.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
148
tests/wpt/web-platform-tests/webstorage/event_body_attribute.js
Normal file
148
tests/wpt/web-platform-tests/webstorage/event_body_attribute.js
Normal file
|
@ -0,0 +1,148 @@
|
||||||
|
test(function() {
|
||||||
|
var name ;
|
||||||
|
testStorages(runTest);
|
||||||
|
|
||||||
|
function runTest(storageString, callback)
|
||||||
|
{
|
||||||
|
name = storageString;
|
||||||
|
window.completionCallback = callback;
|
||||||
|
|
||||||
|
assert_true(storageString in window, storageString + " exist");
|
||||||
|
window.storage = eval(storageString);
|
||||||
|
|
||||||
|
storage.clear();
|
||||||
|
assert_equals(storage.length, 0, "storage.length");
|
||||||
|
|
||||||
|
iframe.onload = step1;
|
||||||
|
iframe.src = "iframe/event_body_handler.html";
|
||||||
|
}
|
||||||
|
|
||||||
|
function step1(msg)
|
||||||
|
{
|
||||||
|
storageEventList = new Array();
|
||||||
|
storage.setItem('FOO', 'BAR');
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function shouldBeEqualToString(express, expectValue) {
|
||||||
|
assert_equals(typeof express, "string");
|
||||||
|
assert_equals(express, expectValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step2(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 1);
|
||||||
|
shouldBeEqualToString(storageEventList[0].key, "FOO");
|
||||||
|
assert_equals(storageEventList[0].oldValue, null);
|
||||||
|
shouldBeEqualToString(storageEventList[0].newValue, "BAR");
|
||||||
|
}, name + ": the first storage event properties");
|
||||||
|
|
||||||
|
storage.setItem('FU', 'BAR');
|
||||||
|
storage.setItem('a', '1');
|
||||||
|
storage.setItem('b', '2');
|
||||||
|
storage.setItem('b', '3');
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step3, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step3(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 5);
|
||||||
|
shouldBeEqualToString(storageEventList[1].key, "FU");
|
||||||
|
assert_equals(storageEventList[1].oldValue, null);
|
||||||
|
shouldBeEqualToString(storageEventList[1].newValue, "BAR");
|
||||||
|
}, name + ": the second storage event properties");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
shouldBeEqualToString(storageEventList[2].key, "a");
|
||||||
|
assert_equals(storageEventList[2].oldValue, null);
|
||||||
|
shouldBeEqualToString(storageEventList[2].newValue, "1");
|
||||||
|
}, name + ": the third storage event properties");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
shouldBeEqualToString(storageEventList[3].key, "b");
|
||||||
|
assert_equals(storageEventList[3].oldValue, null);
|
||||||
|
shouldBeEqualToString(storageEventList[3].newValue, "2");
|
||||||
|
}, name + ": the fourth storage event properties");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
shouldBeEqualToString(storageEventList[4].key, "b");
|
||||||
|
shouldBeEqualToString(storageEventList[4].oldValue, "2");
|
||||||
|
shouldBeEqualToString(storageEventList[4].newValue, "3");
|
||||||
|
}, name + ": the fifth storage event properties");
|
||||||
|
|
||||||
|
|
||||||
|
storage.removeItem('FOO');
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step4, 6);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step4(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 6);
|
||||||
|
shouldBeEqualToString(storageEventList[5].key, "FOO");
|
||||||
|
shouldBeEqualToString(storageEventList[5].oldValue, "BAR");
|
||||||
|
assert_equals(storageEventList[5].newValue, null);
|
||||||
|
}, name + ": the sixth storage event properties");
|
||||||
|
|
||||||
|
storage.removeItem('FU');
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step5, 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step5(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 7);
|
||||||
|
shouldBeEqualToString(storageEventList[6].key, "FU");
|
||||||
|
shouldBeEqualToString(storageEventList[6].oldValue, "BAR");
|
||||||
|
assert_equals(storageEventList[6].newValue, null);
|
||||||
|
}, name + ": the seventh storage event properties");
|
||||||
|
|
||||||
|
storage.clear();
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step6, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step6(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 8);
|
||||||
|
assert_equals(storageEventList[7].key, null);
|
||||||
|
assert_equals(storageEventList[7].oldValue, null);
|
||||||
|
assert_equals(storageEventList[7].newValue, null);
|
||||||
|
}, name + ": the eighth storage event properties");
|
||||||
|
|
||||||
|
completionCallback();
|
||||||
|
}
|
||||||
|
|
||||||
|
}, "DOM Storage mutations fire StorageEvents that are caught by the event listener specified as an attribute on the body.");
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta name="timeout" content="long">
|
||||||
|
<title>WebStorage Test: StorageEvent - the case of value changed</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="log"></div>
|
||||||
|
<script src="eventTestHarness.js"></script>
|
||||||
|
<script src="event_case_sensitive.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
test(function() {
|
||||||
|
var name ;
|
||||||
|
testStorages(runTest);
|
||||||
|
|
||||||
|
function runTest(storageString, callback)
|
||||||
|
{
|
||||||
|
name = storageString;
|
||||||
|
window.completionCallback = callback;
|
||||||
|
|
||||||
|
assert_true(storageString in window, storageString + " exist");
|
||||||
|
window.storage = eval(storageString);
|
||||||
|
|
||||||
|
storage.clear();
|
||||||
|
assert_equals(storage.length, 0, "storage.length");
|
||||||
|
storage.foo = "test";
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step1(msg)
|
||||||
|
{
|
||||||
|
storageEventList = new Array();
|
||||||
|
storage.foo = "test";
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step2, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step2(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 0);
|
||||||
|
}, name + ": The key/value does not change, the event is not fired.");
|
||||||
|
|
||||||
|
storage.foo = "TEST";
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step3, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step3(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 1);
|
||||||
|
}, name + ": The event is fired when the value case is changed.");
|
||||||
|
|
||||||
|
completionCallback();
|
||||||
|
}
|
||||||
|
}, "storage events fire even when only the case of the value changes.");
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta name="timeout" content="long">
|
||||||
|
<title>WebStorage Test: StorageEvent - attached setAttribute</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="log"></div>
|
||||||
|
<script src="eventTestHarness.js"></script>
|
||||||
|
<script src="event_setattribute.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
149
tests/wpt/web-platform-tests/webstorage/event_setattribute.js
Normal file
149
tests/wpt/web-platform-tests/webstorage/event_setattribute.js
Normal file
|
@ -0,0 +1,149 @@
|
||||||
|
test(function() {
|
||||||
|
var name ;
|
||||||
|
testStorages(runTest);
|
||||||
|
|
||||||
|
function runTest(storageString, callback)
|
||||||
|
{
|
||||||
|
name = storageString;
|
||||||
|
window.completionCallback = callback;
|
||||||
|
|
||||||
|
assert_true(storageString in window, storageString + " exist");
|
||||||
|
window.storage = eval(storageString);
|
||||||
|
|
||||||
|
storageEventList = new Array();
|
||||||
|
storage.clear();
|
||||||
|
assert_equals(storage.length, 0, "storage.length");
|
||||||
|
|
||||||
|
iframe.onload = step1;
|
||||||
|
iframe.src = "iframe/event_setattribute_handler.html";
|
||||||
|
}
|
||||||
|
|
||||||
|
function step1(msg)
|
||||||
|
{
|
||||||
|
storageEventList = new Array();
|
||||||
|
storage.setItem('FOO', 'BAR');
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function shouldBeEqualToString(express, expectValue) {
|
||||||
|
assert_equals(typeof express, "string");
|
||||||
|
assert_equals(express, expectValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step2(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 1);
|
||||||
|
shouldBeEqualToString(storageEventList[0].key, "FOO");
|
||||||
|
assert_equals(storageEventList[0].oldValue, null);
|
||||||
|
shouldBeEqualToString(storageEventList[0].newValue, "BAR");
|
||||||
|
}, name + ": the first storage event properties");
|
||||||
|
|
||||||
|
storage.setItem('FU', 'BAR');
|
||||||
|
storage.setItem('a', '1');
|
||||||
|
storage.setItem('b', '2');
|
||||||
|
storage.setItem('b', '3');
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step3, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step3(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 5);
|
||||||
|
shouldBeEqualToString(storageEventList[1].key, "FU");
|
||||||
|
assert_equals(storageEventList[1].oldValue, null);
|
||||||
|
shouldBeEqualToString(storageEventList[1].newValue, "BAR");
|
||||||
|
}, name + ": the second storage event properties");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
shouldBeEqualToString(storageEventList[2].key, "a");
|
||||||
|
assert_equals(storageEventList[2].oldValue, null);
|
||||||
|
shouldBeEqualToString(storageEventList[2].newValue, "1");
|
||||||
|
}, name + ": the third storage event properties");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
shouldBeEqualToString(storageEventList[3].key, "b");
|
||||||
|
assert_equals(storageEventList[3].oldValue, null);
|
||||||
|
shouldBeEqualToString(storageEventList[3].newValue, "2");
|
||||||
|
}, name + ": the forth storage event properties");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
shouldBeEqualToString(storageEventList[4].key, "b");
|
||||||
|
shouldBeEqualToString(storageEventList[4].oldValue, "2");
|
||||||
|
shouldBeEqualToString(storageEventList[4].newValue, "3");
|
||||||
|
}, name + ": the fifth storage event properties");
|
||||||
|
|
||||||
|
|
||||||
|
storage.removeItem('FOO');
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step4, 6);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step4(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 6);
|
||||||
|
shouldBeEqualToString(storageEventList[5].key, "FOO");
|
||||||
|
shouldBeEqualToString(storageEventList[5].oldValue, "BAR");
|
||||||
|
assert_equals(storageEventList[5].newValue, null);
|
||||||
|
}, name + ": the sixth storage event properties");
|
||||||
|
|
||||||
|
storage.removeItem('FU');
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step5, 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step5(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 7);
|
||||||
|
shouldBeEqualToString(storageEventList[6].key, "FU");
|
||||||
|
shouldBeEqualToString(storageEventList[6].oldValue, "BAR");
|
||||||
|
assert_equals(storageEventList[6].newValue, null);
|
||||||
|
}, name + ": the seventh storage event properties");
|
||||||
|
|
||||||
|
storage.clear();
|
||||||
|
|
||||||
|
runAfterNStorageEvents(step6, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
function step6(msg)
|
||||||
|
{
|
||||||
|
test(function() {
|
||||||
|
if(msg != undefined) {
|
||||||
|
assert_unreached(msg);
|
||||||
|
}
|
||||||
|
assert_equals(storageEventList.length, 8);
|
||||||
|
assert_equals(storageEventList[7].key, null);
|
||||||
|
assert_equals(storageEventList[7].oldValue, null);
|
||||||
|
assert_equals(storageEventList[7].newValue, null);
|
||||||
|
}, name + ": the eighth storage event properties");
|
||||||
|
|
||||||
|
completionCallback();
|
||||||
|
}
|
||||||
|
|
||||||
|
}, "DOM Storage mutations fire StorageEvents that are caught by the event listener attached via setattribute.");
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function handleStorageEvent(e) {
|
||||||
|
window.parent.storageEventList.push(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body onstorage="handleStorageEvent(window.event);">
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,15 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head></head>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function handleStorageEvent(e) {
|
||||||
|
window.parent.storageEventList.push(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
document.body.setAttribute("onstorage", "handleStorageEvent(window.event);");
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,41 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>WebStorage Test: Storage - enumerate and built-in properties</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="log"></div>
|
||||||
|
<script>
|
||||||
|
["localStorage", "sessionStorage"].forEach(function(name) {
|
||||||
|
test(function() {
|
||||||
|
assert_true(name in window, name + " exist");
|
||||||
|
|
||||||
|
var storage = window[name];
|
||||||
|
storage.clear();
|
||||||
|
|
||||||
|
Storage.prototype.prototypeTestKey = "prototypeTestValue";
|
||||||
|
storage.foo = "bar";
|
||||||
|
storage.fu = "baz";
|
||||||
|
storage.batman = "bin suparman";
|
||||||
|
storage.bar = "foo";
|
||||||
|
storage.alpha = "beta";
|
||||||
|
storage.zeta = "gamma";
|
||||||
|
|
||||||
|
var enumeratedArray = new Array();
|
||||||
|
for (var n in storage)
|
||||||
|
enumeratedArray.push(n);
|
||||||
|
|
||||||
|
// Sort the array, since the storage order isn't guaranteed
|
||||||
|
enumeratedArray.sort();
|
||||||
|
|
||||||
|
var expectArray = ["alpha", "bar", "batman", "foo", "fu", "prototypeTestKey", "zeta"];
|
||||||
|
assert_array_equals(enumeratedArray, expectArray);
|
||||||
|
|
||||||
|
}, name + ": enumerate a Storage object and get only the keys as a result and the built-in properties of the Storage object should be ignored");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>WebStorage Test: Storage - set key with the same name as storage function</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="log"></div>
|
||||||
|
<script>
|
||||||
|
["localStorage", "sessionStorage"].forEach(function(name) {
|
||||||
|
test(function() {
|
||||||
|
var storage = window[name];
|
||||||
|
storage.clear();
|
||||||
|
|
||||||
|
runTest();
|
||||||
|
function doWedgeThySelf() {
|
||||||
|
storage.setItem("clear", "almost");
|
||||||
|
storage.setItem("key", "too");
|
||||||
|
storage.setItem("getItem", "funny");
|
||||||
|
storage.setItem("removeItem", "to");
|
||||||
|
storage.setItem("length", "be");
|
||||||
|
storage.setItem("setItem", "true");
|
||||||
|
}
|
||||||
|
|
||||||
|
function shouldBeEqualToString(express, expectValue) {
|
||||||
|
assert_equals(typeof express, "string");
|
||||||
|
assert_equals(express, expectValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
function runTest() {
|
||||||
|
doWedgeThySelf();
|
||||||
|
|
||||||
|
shouldBeEqualToString(storage.getItem('clear'), "almost");
|
||||||
|
shouldBeEqualToString(storage.getItem('key'), "too");
|
||||||
|
shouldBeEqualToString(storage.getItem('getItem'), "funny");
|
||||||
|
shouldBeEqualToString(storage.getItem('removeItem'), "to");
|
||||||
|
shouldBeEqualToString(storage.getItem('length'), "be");
|
||||||
|
shouldBeEqualToString(storage.getItem('setItem'), "true");
|
||||||
|
|
||||||
|
// Test to see if an exception is thrown for any of the built in
|
||||||
|
// functions.
|
||||||
|
storage.setItem("test", "123");
|
||||||
|
storage.key(0);
|
||||||
|
storage.getItem("test");
|
||||||
|
storage.removeItem("test");
|
||||||
|
storage.clear();
|
||||||
|
assert_equals(storage.length, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}, name + " should be not rendered unusable by setting a key with the same name as a storage function such that the function is hidden");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -20,12 +20,12 @@
|
||||||
assert_throws("QUOTA_EXCEEDED_ERR", function() {
|
assert_throws("QUOTA_EXCEEDED_ERR", function() {
|
||||||
while (true) {
|
while (true) {
|
||||||
index++;
|
index++;
|
||||||
localStorage.setItem("" + key + index, "" + name + index);
|
localStorage.setItem("" + key + index, "" + index);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
}, "Throws QuotaExceededError when the quota of " + name + " has been exceeded");
|
}, "Throws QuotaExceededError when the quota has been exceeded");
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>WebStorage Test: localStorage - open a existing browsing context</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="log"></div>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
assert_true("localStorage" in window, "localStorage exist");
|
||||||
|
|
||||||
|
var storage = window.localStorage;
|
||||||
|
storage.clear();
|
||||||
|
|
||||||
|
storage.setItem("FOO", "BAR");
|
||||||
|
assert_equals(storage.getItem("FOO"), "BAR", "storage.getItem('FOO')");
|
||||||
|
window.open("storage_local_window_open_second.html");
|
||||||
|
|
||||||
|
}, "A new window to make sure there is a copy of the previous window's localStorage, and that they diverge after a change");
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>WebStorage Test: localStorage - second page</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="log"></div>
|
||||||
|
<script>
|
||||||
|
test(function() {
|
||||||
|
assert_true("localStorage" in window, "localStorage exist");
|
||||||
|
|
||||||
|
var storage = window.localStorage;
|
||||||
|
|
||||||
|
assert_equals(storage.getItem("FOO"), "BAR", "storage.getItem('FOO')");
|
||||||
|
storage.setItem("FOO", "BAR-NEWWINDOW");
|
||||||
|
assert_equals(storage.getItem("FOO"), "BAR-NEWWINDOW", "value for FOO after changing");
|
||||||
|
|
||||||
|
assert_equals(window.opener.localStorage.getItem("FOO"), "BAR-NEWWINDOW", "value for FOO in my opening window");
|
||||||
|
|
||||||
|
}, "A new window to make sure there is a copy of the previous window's localStorage, and that they diverge after a change");
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -20,12 +20,12 @@
|
||||||
assert_throws("QUOTA_EXCEEDED_ERR", function() {
|
assert_throws("QUOTA_EXCEEDED_ERR", function() {
|
||||||
while (true) {
|
while (true) {
|
||||||
index++;
|
index++;
|
||||||
sessionStorage.setItem("" + key + index, "" + name + index);
|
sessionStorage.setItem("" + key + index, "" + index);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
sessionStorage.clear();
|
sessionStorage.clear();
|
||||||
}, "Throws QuotaExceededError when the quota of " + name + " has been exceeded");
|
}, "Throws QuotaExceededError when the quota has been exceeded");
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>WebStorage Test: sessionStorage - open a existing browsing context</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="log"></div>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
assert_true("sessionStorage" in window, "sessionStorage exist");
|
||||||
|
|
||||||
|
var storage = window.sessionStorage;
|
||||||
|
|
||||||
|
storage.setItem("FOO", "BAR");
|
||||||
|
assert_equals(storage.getItem("FOO"), "BAR", "storage.getItem('FOO')");
|
||||||
|
window.open("storage_session_window_open_second.html");
|
||||||
|
|
||||||
|
}, "A new window to make sure there is a copy of the previous window's sessionStorage, and that they diverge after a change");
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>WebStorage Test: sessionStorage - second page</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="log"></div>
|
||||||
|
<script>
|
||||||
|
test(function() {
|
||||||
|
assert_true("sessionStorage" in window, "sessionStorage exist");
|
||||||
|
|
||||||
|
var storage = window.sessionStorage;
|
||||||
|
|
||||||
|
assert_equals(storage.getItem("FOO"), "BAR", "storage.getItem('FOO')");
|
||||||
|
storage.setItem("FOO", "BAR-NEWWINDOW");
|
||||||
|
assert_equals(storage.getItem("FOO"), "BAR-NEWWINDOW", "value for FOO after changing");
|
||||||
|
|
||||||
|
assert_equals(window.opener.sessionStorage.getItem("FOO"), "BAR", "value for FOO in my opening window");
|
||||||
|
|
||||||
|
}, "A new window to make sure there is a copy of the previous window's sessionStorage, and that they diverge after a change");
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>WebStorage Test: Storage only store strings</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="log"></div>
|
||||||
|
<script>
|
||||||
|
["localStorage", "sessionStorage"].forEach(function(name) {
|
||||||
|
test(function() {
|
||||||
|
assert_true(name in window, name + " exist");
|
||||||
|
|
||||||
|
var storage = window[name];
|
||||||
|
storage.clear();
|
||||||
|
|
||||||
|
assert_equals(storage.length, 0);
|
||||||
|
|
||||||
|
function shouldBeEqualToString(express, expectValue) {
|
||||||
|
assert_equals(typeof express, "string");
|
||||||
|
assert_equals(express, expectValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
storage.a = null;
|
||||||
|
shouldBeEqualToString(storage.a, "null");
|
||||||
|
storage.b = 0;
|
||||||
|
shouldBeEqualToString(storage.b, "0");
|
||||||
|
storage.c = function(){};
|
||||||
|
shouldBeEqualToString(storage.c, "function (){}");
|
||||||
|
|
||||||
|
storage.setItem('d', null);
|
||||||
|
shouldBeEqualToString(storage.d, "null");
|
||||||
|
storage.setItem('e', 0);
|
||||||
|
shouldBeEqualToString(storage.e, "0");
|
||||||
|
storage.setItem('f', function(){});
|
||||||
|
shouldBeEqualToString(storage.f, "function (){}");
|
||||||
|
|
||||||
|
storage['g'] = null;
|
||||||
|
shouldBeEqualToString(storage.g, "null");
|
||||||
|
storage['h'] = 0;
|
||||||
|
shouldBeEqualToString(storage.h, "0");
|
||||||
|
storage['i'] = function(){};
|
||||||
|
shouldBeEqualToString(storage.f, "function (){}");
|
||||||
|
|
||||||
|
}, name + " only stores strings");
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue