mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Auto merge of #19232 - jdm:updatewpt8, r=jdm
Update web-platform-tests. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19232) <!-- Reviewable:end -->
This commit is contained in:
commit
62aa91e0dc
1048 changed files with 45893 additions and 14716 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -9,6 +9,7 @@
|
|||
/ports/android/obj
|
||||
/python/_virtualenv
|
||||
/python/tidy/servo_tidy.egg-info
|
||||
/tests/wpt/sync
|
||||
*~
|
||||
*.pkl
|
||||
*.pyc
|
||||
|
|
|
@ -71,7 +71,7 @@ def create_parser_wpt():
|
|||
parser = wptcommandline.create_parser()
|
||||
parser.add_argument('--release', default=False, action="store_true",
|
||||
help="Run with a release build of servo")
|
||||
parser.add_argument('--chaos', default=False, action="store_true",
|
||||
parser.add_argument('--rr-chaos', default=False, action="store_true",
|
||||
help="Run under chaos mode in rr until a failure is captured")
|
||||
parser.add_argument('--pref', default=[], action="append", dest="prefs",
|
||||
help="Pass preferences to servo")
|
||||
|
@ -471,7 +471,7 @@ class MachCommands(CommandBase):
|
|||
|
||||
os.environ["RUST_BACKTRACE"] = "1"
|
||||
kwargs["debug"] = not kwargs["release"]
|
||||
if kwargs.pop("chaos"):
|
||||
if kwargs.pop("rr_chaos"):
|
||||
kwargs["debugger"] = "rr"
|
||||
kwargs["debugger_args"] = "record --chaos"
|
||||
kwargs["repeat_until_unexpected"] = True
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,11 +0,0 @@
|
|||
[getallresponseheaders-cl.htm]
|
||||
type: testharness
|
||||
[Casing of known headers]
|
||||
expected: FAIL
|
||||
|
||||
[Casing of known headers 1]
|
||||
expected: FAIL
|
||||
|
||||
[Casing of known headers 2]
|
||||
expected: FAIL
|
||||
|
|
@ -1,9 +1,11 @@
|
|||
[getallresponseheaders.htm]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[XMLHttpRequest: getAllResponseHeaders()]
|
||||
expected: TIMEOUT
|
||||
expected: FAIL
|
||||
|
||||
[XMLHttpRequest: getAllResponseHeaders() 1]
|
||||
expected: TIMEOUT
|
||||
expected: FAIL
|
||||
|
||||
[XMLHttpRequest: getAllResponseHeaders() 2]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
[open-url-encoding.htm]
|
||||
[percent encode characters]
|
||||
expected: FAIL
|
||||
|
||||
[lone surrogate]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[send-authentication-cors-basic-setrequestheader.htm]
|
||||
type: testharness
|
||||
[XMLHttpRequest: send() - "Basic" authenticated CORS request using setRequestHeader() (expects to succeed)]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[send-authentication-cors-setrequestheader-no-cred.htm]
|
||||
type: testharness
|
||||
[CORS request with setRequestHeader auth to URL accepting Authorization header]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[setrequestheader-case-insensitive.htm]
|
||||
[XMLHttpRequest: setRequestHeader() - headers that differ in case 1]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[overflow-propagation-001a.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[overflow-propagation-001b.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[overflow-propagation-001c.html]
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[visibility-005.xht]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +1,3 @@
|
|||
[box-shadow-syntax-001.xht]
|
||||
type: reftest
|
||||
expected: FAIL
|
||||
expected: TIMEOUT
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
[percentage-heights-003.html]
|
||||
[.flexbox 1]
|
||||
expected: FAIL
|
||||
|
||||
[.flexbox 2]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
[text-decoration-skip-ink.html]
|
||||
[Body must have text-decoration-skip-ink auto by default.]
|
||||
expected: FAIL
|
||||
|
||||
[Property text-decoration-skip-ink must support values auto and none.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[css-transforms-3d-on-anonymous-block-001.html]
|
||||
expected: FAIL
|
|
@ -1,5 +0,0 @@
|
|||
[media-query-list-interface.xht]
|
||||
type: testharness
|
||||
[window_inherits_matchmedia]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[window-interface.xht]
|
||||
type: testharness
|
||||
[window_inherited_functions]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[missing-right-token.html]
|
||||
[attribute selectors with missing right tokens succeed]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
[HTMLInputElement.html]
|
||||
[capture on HTMLInputElement must enqueue an attributeChanged reaction when adding new attribute]
|
||||
expected: FAIL
|
||||
|
||||
[capture on HTMLInputElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[capture on HTMLInputElement must enqueue an attributeChanged reaction when adding invalid value default]
|
||||
expected: FAIL
|
||||
|
||||
[capture on HTMLInputElement must enqueue an attributeChanged reaction when removing the attribute]
|
||||
expected: FAIL
|
||||
|
|
@ -3,3 +3,18 @@
|
|||
[Untitled]
|
||||
expected: FAIL
|
||||
|
||||
[Constructed MouseEvent timestamp should be high resolution and have the same time origin as performance.now()]
|
||||
expected: FAIL
|
||||
|
||||
[Constructed KeyboardEvent timestamp should be high resolution and have the same time origin as performance.now()]
|
||||
expected: FAIL
|
||||
|
||||
[Constructed WheelEvent timestamp should be high resolution and have the same time origin as performance.now()]
|
||||
expected: FAIL
|
||||
|
||||
[Constructed GamepadEvent timestamp should be high resolution and have the same time origin as performance.now()]
|
||||
expected: FAIL
|
||||
|
||||
[Constructed FocusEvent timestamp should be high resolution and have the same time origin as performance.now()]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
[request-headers-case.any.html]
|
||||
[Multiple headers with the same name, different case (THIS-is-A-test first)]
|
||||
expected: FAIL
|
||||
|
||||
[Multiple headers with the same name, different case (THIS-IS-A-TEST first)]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[request-headers-case.any.worker.html]
|
||||
[Multiple headers with the same name, different case (THIS-is-A-test first)]
|
||||
expected: FAIL
|
||||
|
||||
[Multiple headers with the same name, different case (THIS-IS-A-TEST first)]
|
||||
expected: FAIL
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
[cors-filtering-worker.html]
|
||||
type: testharness
|
||||
[CORS filter on Set-Cookie header]
|
||||
expected: FAIL
|
||||
|
||||
[CORS filter on Set-Cookie header, header is forbidden]
|
||||
expected: FAIL
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
[cors-filtering.html]
|
||||
type: testharness
|
||||
[CORS filter on Set-Cookie header]
|
||||
expected: FAIL
|
||||
|
||||
[CORS filter on Set-Cookie header, header is forbidden]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[navigation-in-onload.tentative.html]
|
||||
[Navigation in onload handler]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-1a.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-1b.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-1c.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-1d.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-1e.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-1f.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-1i.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-1j.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-1k.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-1l.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-2a.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-2b.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-2c.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-2d.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-2e.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-2f.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-2i.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-2j.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-2k.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[body-margin-2l.html]
|
||||
expected: FAIL
|
|
@ -172,3 +172,93 @@
|
|||
[XHTML img usemap="http://example.org/#garbage-before-hash-id"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (standards) IMG usemap="no-hash-name"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (standards) IMG usemap="no-hash-id"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (standards) IMG usemap="hash-last#"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (standards) IMG usemap=""]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (standards) IMG usemap="#"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (standards) IMG usemap="#percent-escape-name-%41"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (standards) IMG usemap="#percent-escape-id-%41"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (standards) IMG usemap="#no-such-map"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (standards) IMG usemap="#different-CASE-name"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (standards) IMG usemap="#different-CASE-id"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (quirks) IMG usemap="no-hash-name"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (quirks) IMG usemap="no-hash-id"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (quirks) IMG usemap="hash-last#"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (quirks) IMG usemap=""]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (quirks) IMG usemap="#"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (quirks) IMG usemap="#percent-escape-name-%41"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (quirks) IMG usemap="#percent-escape-id-%41"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (quirks) IMG usemap="#no-such-map"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (quirks) IMG usemap="#different-CASE-name"]
|
||||
expected: FAIL
|
||||
|
||||
[HTML (quirks) IMG usemap="#different-CASE-id"]
|
||||
expected: FAIL
|
||||
|
||||
[XHTML img usemap="no-hash-name"]
|
||||
expected: FAIL
|
||||
|
||||
[XHTML img usemap="no-hash-id"]
|
||||
expected: FAIL
|
||||
|
||||
[XHTML img usemap="hash-last#"]
|
||||
expected: FAIL
|
||||
|
||||
[XHTML img usemap=""]
|
||||
expected: FAIL
|
||||
|
||||
[XHTML img usemap="#"]
|
||||
expected: FAIL
|
||||
|
||||
[XHTML img usemap="#percent-escape-name-%41"]
|
||||
expected: FAIL
|
||||
|
||||
[XHTML img usemap="#percent-escape-id-%41"]
|
||||
expected: FAIL
|
||||
|
||||
[XHTML img usemap="#no-such-map"]
|
||||
expected: FAIL
|
||||
|
||||
[XHTML img usemap="#different-CASE-name"]
|
||||
expected: FAIL
|
||||
|
||||
[XHTML img usemap="#different-CASE-id"]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
[selection-start-end.html]
|
||||
type: testharness
|
||||
|
||||
[onselect should fire when selectionStart is changed]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -59,3 +59,4 @@
|
|||
|
||||
[value IDL attribute of input type email with value attribute]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[option-text-setter.html]
|
||||
[Verify that using HTMLOptionElement.text setter does not update the existing text child node.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
local: b74f52d6df118d832db08276ebe698fee2fa2265
|
||||
upstream: f1d5e1dcd20176cee05692bd78863e9b03ace93b
|
||||
local: 85fa6409bb699647b4f5e22952538365e87418d7
|
||||
upstream: 40ee9a4553dca805163766c5970979a23e357292
|
||||
|
|
4
tests/wpt/metadata/url/data-uri-fragment.html.ini
Normal file
4
tests/wpt/metadata/url/data-uri-fragment.html.ini
Normal file
|
@ -0,0 +1,4 @@
|
|||
[data-uri-fragment.html]
|
||||
[Data URI parsing of fragments]
|
||||
expected: FAIL
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
[005.html]
|
||||
type: testharness
|
||||
[WebSockets: proper first line]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[005.html?wss]
|
||||
type: testharness
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
[long-expressions-should-not-crash.html]
|
||||
type: testharness
|
||||
expected:
|
||||
if os == "linux": CRASH
|
||||
if os == "mac": TIMEOUT
|
||||
[Overall test]
|
||||
expected: NOTRUN
|
||||
|
|
@ -12,6 +12,7 @@ from mozlog.structured import structuredlog
|
|||
here = os.path.split(__file__)[0]
|
||||
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(here, os.pardir, "web-platform-tests", "tools", "wptrunner")))
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(here, os.pardir, "web-platform-tests", "tools", "wptserve")))
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(here, os.pardir, "tests", "tools", "scripts")))
|
||||
|
||||
from wptrunner.update import setup_logging, WPTUpdate
|
||||
|
|
|
@ -26,7 +26,9 @@ matrix:
|
|||
include:
|
||||
- os: linux
|
||||
python: "2.7"
|
||||
env: JOB=manifest_upload SCRIPT=tools/ci/ci_manifest.sh
|
||||
env:
|
||||
- JOB=manifest_upload SCRIPT=tools/ci/ci_manifest.sh
|
||||
- secure: "FrlMkMZiwggnhJbLiLxZ4imtXxuzFNozty94g1mneMPEVLrnyhb6c/g2SwN37KKU0WSDlGTz26IYnFvo1ftfSOx+sjRz0HqwW7JnrXULKYo7jiPttIcmeJxlSVeW9yS4blbLaBakytHjSnsf+za7bAaf1aS7RRAtAINgifA6Chg="
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>IndexedDB: Index iteration with cursor updates/deletes</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support.js"></script>
|
||||
<script>
|
||||
const objStoreValues = [
|
||||
{name: 'foo', id: 1},
|
||||
{name: 'bar', id: 2},
|
||||
{name: 'foo', id: 3},
|
||||
{name: 'bar', id: 4},
|
||||
];
|
||||
|
||||
const objStoreValuesByIndex = [
|
||||
objStoreValues[1],
|
||||
objStoreValues[3],
|
||||
objStoreValues[0],
|
||||
objStoreValues[2],
|
||||
];
|
||||
|
||||
const functionsThatShouldNotAffectIteration = [
|
||||
cursor => cursor.update({}),
|
||||
cursor => cursor.delete(),
|
||||
];
|
||||
|
||||
functionsThatShouldNotAffectIteration.forEach((func) => indexeddb_test(
|
||||
(t, db) => {
|
||||
const objStore = db.createObjectStore('items', {autoIncrement: true});
|
||||
objStore.createIndex('name', 'name', {unique: false});
|
||||
objStoreValues.forEach((value) => objStore.add(value));
|
||||
},
|
||||
(t, db) => {
|
||||
const txn = db.transaction('items', 'readwrite');
|
||||
const objStore = txn.objectStore('items');
|
||||
const nameIndex = objStore.index('name');
|
||||
|
||||
const cursorValues = [];
|
||||
nameIndex.openCursor().onsuccess = (evt) => {
|
||||
const cursor = evt.target.result;
|
||||
if (cursor) {
|
||||
func(cursor);
|
||||
cursorValues.push(cursor.value);
|
||||
cursor.continue();
|
||||
} else {
|
||||
assert_equals(cursorValues.length, 4,
|
||||
`Cursor should iterate over 4 records`);
|
||||
|
||||
cursorValues.forEach((value, i) => {
|
||||
assert_object_equals(value, objStoreValuesByIndex[i]);
|
||||
});
|
||||
t.done();
|
||||
}
|
||||
}
|
||||
},
|
||||
`Calling ${func} doesn't affect index iteration`
|
||||
));
|
||||
</script>
|
109
tests/wpt/web-platform-tests/IndexedDB/wasm-module-value.html
Normal file
109
tests/wpt/web-platform-tests/IndexedDB/wasm-module-value.html
Normal file
|
@ -0,0 +1,109 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>IndexedDB: WebAssembly module values</title>
|
||||
<link rel="help" href="https://w3c.github.io/IndexedDB/">
|
||||
<link rel="help" href="https://webassembly.github.io/spec/">
|
||||
<link rel="author" href="pwnall@chromium.org" title="Victor Costan">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support-promises.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
// Binary representation for a WASM module that exports an "inc" function.
|
||||
//
|
||||
// This test covers storing WASM modules in IndexedDB. Its failure should only
|
||||
// be debugged if WASM specification tests pass. To this end, the test does not
|
||||
// use the WASM module builder helpers, trading off WASM debuggability in return
|
||||
// for having the WASM wire bytes listed explicitly in the test body. Having the
|
||||
// wire bytes spelled out can be helpful when debugging IndexedDB failures.
|
||||
let wasm_module_bytes = new Uint8Array([
|
||||
0x00, 0x61, 0x73, 0x6d, // Magic.
|
||||
0x01, 0x00, 0x00, 0x00, // Version.
|
||||
0x01, 0x06, 0x01, // Type section - 6 bytes, 1 entry
|
||||
0x60, 0x01, 0x7f, 0x01, 0x7f, // Type 0. Function: (i32) -> (i32)
|
||||
0x03, 0x02, 0x01, // Function section - 2 bytes, 1 entry
|
||||
0x00, // Function 0: Type 0
|
||||
0x07, 0x07, 0x01, // Export section - 7 bytes, 1 entry
|
||||
0x03, 0x69, 0x6e, 0x63, // Export 1. { name: "inc"
|
||||
0x00, 0x00, // desc: function 0 }
|
||||
0x0a, 0x09, 0x01, // Code section: 9 bytes, 1 entry
|
||||
0x07, 0x00, // Function 1: 7 code bytes, 0 locals
|
||||
0x20, 0x00, // getlocal 0
|
||||
0x41, 0x01, // i32.const 1
|
||||
0x6a, // i32.add
|
||||
0x0b, // end
|
||||
]);
|
||||
|
||||
promise_test(async testCase => {
|
||||
const wasm_module = await WebAssembly.compile(wasm_module_bytes.buffer);
|
||||
|
||||
const database = await createDatabase(testCase, (database, transaction) => {
|
||||
const store = database.createObjectStore('store');
|
||||
store.put(wasm_module, 'key1');
|
||||
});
|
||||
|
||||
const result = await new Promise((resolve, reject) => {
|
||||
const transaction = database.transaction(['store'], 'readonly');
|
||||
const store = transaction.objectStore('store');
|
||||
const request = store.get('key1');
|
||||
request.onsuccess = (event) => resolve(event.target.result);
|
||||
request.onerror = (event) => reject(event.target.error);
|
||||
});
|
||||
|
||||
database.close();
|
||||
|
||||
const instance = await WebAssembly.instantiate(result);
|
||||
assert_equals(
|
||||
instance.exports['inc'](42), 43, 'inc should increment its argument');
|
||||
}, 'WebAssembly module as an IndexedDB value');
|
||||
|
||||
promise_test(async testCase => {
|
||||
const wasm_module = await WebAssembly.compile(wasm_module_bytes.buffer);
|
||||
|
||||
const database = await createDatabase(testCase, (database, transaction) => {
|
||||
const store = database.createObjectStore('store');
|
||||
store.put({ module: wasm_module }, 'key1');
|
||||
});
|
||||
|
||||
const result = await new Promise((resolve, reject) => {
|
||||
const transaction = database.transaction(['store'], 'readonly');
|
||||
const store = transaction.objectStore('store');
|
||||
const request = store.get('key1');
|
||||
request.onsuccess = (event) => resolve(event.target.result);
|
||||
request.onerror = (event) => reject(event.target.error);
|
||||
});
|
||||
|
||||
database.close();
|
||||
|
||||
const instance = await WebAssembly.instantiate(result.module);
|
||||
assert_equals(
|
||||
instance.exports['inc'](42), 43, 'inc should increment its argument');
|
||||
}, 'WebAssembly module in a JavaScript object IndexedDB value');
|
||||
|
||||
promise_test(async testCase => {
|
||||
const wasm_module = await WebAssembly.compile(wasm_module_bytes.buffer);
|
||||
|
||||
const database = await createDatabase(testCase, (database, transaction) => {
|
||||
const store = database.createObjectStore('store', { keyPath: 'key' });
|
||||
store.put({ key: 'key1', module: wasm_module });
|
||||
});
|
||||
|
||||
const result = await new Promise((resolve, reject) => {
|
||||
const transaction = database.transaction(['store'], 'readonly');
|
||||
const store = transaction.objectStore('store');
|
||||
const request = store.get('key1');
|
||||
request.onsuccess = (event) => resolve(event.target.result);
|
||||
request.onerror = (event) => reject(event.target.error);
|
||||
});
|
||||
|
||||
database.close();
|
||||
|
||||
assert_equals('key1', result.key);
|
||||
const instance = await WebAssembly.instantiate(result.module);
|
||||
assert_equals(
|
||||
instance.exports['inc'](42), 43, 'inc should increment its argument');
|
||||
}, 'WebAssembly module in an IndexedDB value with an inline key');
|
||||
|
||||
</script>
|
|
@ -17,6 +17,10 @@ Setting Up the Repo
|
|||
|
||||
Clone or otherwise get https://github.com/w3c/web-platform-tests.
|
||||
|
||||
Note: because of the frequent creation and deletion of branches in this
|
||||
repo, it is recommended to "prune" stale branches when fetching updates,
|
||||
i.e. use `git pull --prune` (or `git fetch -p && git merge`).
|
||||
|
||||
Running the Tests
|
||||
=================
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
assert_equals(client.statusText, "")
|
||||
assert_equals(client.responseXML, null)
|
||||
assert_equals(client.getAllResponseHeaders(), "")
|
||||
setTimeout(function() {
|
||||
test.step_timeout(function() {
|
||||
assert_array_equals(result, expected)
|
||||
test.done();
|
||||
}, 100); // wait a bit in case XHR timeout causes spurious event
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
assert_equals(client.statusText, "")
|
||||
assert_equals(client.responseXML, null)
|
||||
assert_equals(client.getAllResponseHeaders(), "")
|
||||
setTimeout(function() {
|
||||
test.step_timeout(function() {
|
||||
assert_array_equals(result, expected)
|
||||
test.done();
|
||||
}, 100); // wait a bit in case XHR timeout causes spurious event
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
assert_equals(client.statusText, "")
|
||||
assert_equals(client.responseXML, null)
|
||||
assert_equals(client.getAllResponseHeaders(), "")
|
||||
setTimeout(function() {
|
||||
test.step_timeout(function() {
|
||||
assert_array_equals(result, expected)
|
||||
test.done();
|
||||
}, 100); // wait a bit in case XHR timeout causes spurious event
|
||||
|
@ -51,4 +51,3 @@
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
<!doctype html>
|
||||
<title>Casing of known headers</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const client = new XMLHttpRequest
|
||||
client.open("GET", "resources/header-content-length.asis", false)
|
||||
client.send()
|
||||
assert_equals(client.getAllResponseHeaders(), "content-length: 0\r\n")
|
||||
})
|
||||
test(() => {
|
||||
const client = new XMLHttpRequest
|
||||
client.open("GET", "resources/echo-headers.py", false)
|
||||
client.setRequestHeader("THIS-IS-A-TEST", "1")
|
||||
client.setRequestHeader("THIS-is-A-test", "2")
|
||||
client.setRequestHeader("content-TYPE", "x/x")
|
||||
client.send()
|
||||
assert_regexp_match(client.responseText, /content-TYPE/)
|
||||
assert_regexp_match(client.responseText, /THIS-IS-A-TEST: 1, 2/)
|
||||
})
|
||||
promise_test(() => {
|
||||
return fetch("resources/echo-headers.py", {headers: [["THIS-is-A-test", 1], ["THIS-IS-A-TEST", 2]] }).then(res => res.text()).then(body => {
|
||||
assert_regexp_match(body, /THIS-is-A-test: 1, 2/)
|
||||
})
|
||||
})
|
||||
</script>
|
|
@ -9,15 +9,11 @@
|
|||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var test = async_test()
|
||||
test.step(function() {
|
||||
async_test(function() {
|
||||
var client = new XMLHttpRequest()
|
||||
var headersUnsent = client.getAllResponseHeaders();
|
||||
test.step(function() {
|
||||
assert_equals(headersUnsent, "")
|
||||
});
|
||||
client.onreadystatechange = function() {
|
||||
test.step(function() {
|
||||
assert_equals(client.getAllResponseHeaders(), "")
|
||||
|
||||
client.onreadystatechange = this.step_func(function() {
|
||||
var headers = client.getAllResponseHeaders().toLowerCase()
|
||||
if(client.readyState == 1) {
|
||||
assert_equals(headers, "")
|
||||
|
@ -27,9 +23,8 @@
|
|||
assert_false(headers.indexOf("http/1.") != -1)
|
||||
}
|
||||
if(client.readyState == 4)
|
||||
test.done()
|
||||
this.done()
|
||||
})
|
||||
}
|
||||
client.open("GET", "resources/headers.py")
|
||||
client.send(null)
|
||||
})
|
||||
|
|
|
@ -9,6 +9,7 @@ async_test((t) => {
|
|||
client.onload = t.step_func_done(() => {
|
||||
assert_equals(client.getAllResponseHeaders(), "foo-test: 1, 2, 3\r\n")
|
||||
})
|
||||
client.onerror = t.unreached_func("unexpected error")
|
||||
client.open("GET", "resources/headers-basic.asis")
|
||||
client.send(null)
|
||||
})
|
||||
|
@ -18,7 +19,15 @@ async_test((t) => {
|
|||
client.onload = t.step_func_done(() => {
|
||||
assert_equals(client.getAllResponseHeaders(), "also-here: Mr. PB\r\newok: lego\r\nfoo-test: 1, 2\r\n")
|
||||
})
|
||||
client.onerror = t.unreached_func("unexpected error")
|
||||
client.open("GET", "resources/headers.asis")
|
||||
client.send(null)
|
||||
})
|
||||
|
||||
test(() => {
|
||||
const client = new XMLHttpRequest
|
||||
client.open("GET", "resources/header-content-length.asis", false)
|
||||
client.send()
|
||||
assert_equals(client.getAllResponseHeaders(), "content-length: 0\r\n")
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
var client = new XMLHttpRequest()
|
||||
client.open("GET", "resources/content.py?\u00DF", false) // This is the German "eszett" character
|
||||
client.send()
|
||||
assert_equals(client.getResponseHeader("x-request-query"), "%C3%9F")
|
||||
assert_equals(client.getResponseHeader("x-request-query"), "%DF")
|
||||
}, "percent encode characters");
|
||||
test(function() {
|
||||
var client = new XMLHttpRequest()
|
||||
client.open("GET", "resources/content.py?\uD83D", false)
|
||||
client.send()
|
||||
assert_equals(client.getResponseHeader("x-request-query"), "%EF%BF%BD")
|
||||
}, "lone surrogate should return U+FFFD");
|
||||
assert_equals(client.getResponseHeader("x-request-query"), "&%2365533;")
|
||||
}, "lone surrogate");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
ifr.onload = function() {
|
||||
// Again, do things async so we're not doing loads from inside
|
||||
// load events.
|
||||
setTimeout(function() {
|
||||
test.step_timeout(function() {
|
||||
client = new ifr.contentWindow.XMLHttpRequest();
|
||||
count++;
|
||||
// Important to do a normal navigation, not a reload.
|
||||
|
|
|
@ -1,43 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>XMLHttpRequest: redirected worker scripts, origin and referrer</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
var test = async_test() // This "test" does not actually do any assertations. It's just there to have multiple, separate, asyncronous sub-tests.
|
||||
var expectations = {
|
||||
'Referer header': 'Referer: '+(location.href.replace(/[^/]*$/, ''))+"resources/workerxhr-origin-referrer.js\n",
|
||||
'Origin header': 'Origin: '+location.protocol+'//'+location.hostname+((location.port === "")?"":":"+location.port)+'\n',
|
||||
'Request URL test' : (location.href.replace(/[^/]*$/, ''))+'resources/requri.py?full'
|
||||
}
|
||||
// now start the worker
|
||||
var finalWorkerURL = "workerxhr-origin-referrer.js";
|
||||
var url = "resources/redirect.py?location=" + encodeURIComponent(finalWorkerURL);
|
||||
var worker = new Worker(url)
|
||||
worker.onmessage = function (e) {
|
||||
var subtest = async_test(e.data.test)
|
||||
subtest.step(function(){
|
||||
var thisExpectation = expectations[e.data.test]
|
||||
delete expectations[e.data.test]
|
||||
assert_equals(e.data.result, thisExpectation)
|
||||
subtest.done()
|
||||
})
|
||||
var allDone = true
|
||||
for(var prop in expectations){
|
||||
allDone = false
|
||||
}
|
||||
if(allDone){
|
||||
test.step(function(){
|
||||
test.done()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>XMLHttpRequest: redirected worker scripts, origin and referrer</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var finalWorkerURL = "workerxhr-origin-referrer.js";
|
||||
var url = "resources/redirect.py?location=" + encodeURIComponent(finalWorkerURL);
|
||||
fetch_tests_from_worker(new Worker(url));
|
||||
</script>
|
||||
|
|
|
@ -1,43 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>XMLHttpRequest: worker scripts, origin and referrer</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::OL[1]/LI[3] following::OL[1]/LI[3]/ol[1]/li[1] following::OL[1]/LI[3]/ol[1]/li[2] following::OL[1]/LI[3]/ol[1]/li[3]" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
var test = async_test() // This "test" does not actually do any assertations. It's just there to have multiple, separate, asyncronous sub-tests.
|
||||
var expectations = {
|
||||
'Referer header': 'Referer: '+(location.href.replace(/[^/]*$/, ''))+"resources/workerxhr-origin-referrer.js\n",
|
||||
'Origin header': 'Origin: '+location.protocol+'//'+location.hostname+((location.port === "")?"":":"+location.port)+'\n',
|
||||
'Request URL test' : (location.href.replace(/[^/]*$/, ''))+'resources/requri.py?full'
|
||||
}
|
||||
// now start the worker
|
||||
var worker = new Worker("resources/workerxhr-origin-referrer.js")
|
||||
worker.onmessage = function (e) {
|
||||
var subtest = async_test(e.data.test)
|
||||
subtest.step(function(){
|
||||
var thisExpectation = expectations[e.data.test]
|
||||
delete expectations[e.data.test]
|
||||
assert_equals(e.data.result, thisExpectation)
|
||||
subtest.done()
|
||||
})
|
||||
var allDone = true
|
||||
for(var prop in expectations){
|
||||
allDone = false
|
||||
}
|
||||
if(allDone){
|
||||
test.step(function(){
|
||||
test.done()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>XMLHttpRequest: worker scripts, origin and referrer</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
fetch_tests_from_worker(new Worker("resources/workerxhr-origin-referrer.js"));
|
||||
</script>
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
import imp
|
||||
import os
|
||||
|
||||
here = os.path.dirname(__file__)
|
||||
|
||||
|
||||
def main(request, response):
|
||||
response.headers.set('Access-Control-Allow-Origin', request.headers.get("origin"));
|
||||
response.headers.set('Access-Control-Allow-Credentials', 'true');
|
||||
response.headers.set('Access-Control-Allow-Methods', 'GET');
|
||||
response.headers.set('Access-Control-Allow-Headers', 'authorization, x-user, x-pass');
|
||||
response.headers.set('Access-Control-Expose-Headers', 'x-challenge, xhr-user, ses-user');
|
||||
auth = imp.load_source("", os.path.abspath("XMLHttpRequest/resources/authentication.py"))
|
||||
auth = imp.load_source("", os.path.abspath(os.path.join(here, os.pardir, "authentication.py")))
|
||||
if request.method == "OPTIONS":
|
||||
return ""
|
||||
else:
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
import imp
|
||||
import os
|
||||
|
||||
here = os.path.dirname(__file__)
|
||||
|
||||
def main(request, response):
|
||||
response.headers.set('Access-Control-Allow-Origin', request.headers.get("origin"));
|
||||
response.headers.set('Access-Control-Allow-Credentials', 'true');
|
||||
response.headers.set('Access-Control-Allow-Methods', 'GET');
|
||||
response.headers.set('Access-Control-Allow-Headers', 'authorization, x-user, x-pass');
|
||||
response.headers.set('Access-Control-Expose-Headers', 'x-challenge, xhr-user, ses-user');
|
||||
auth = imp.load_source("", os.path.join(os.path.abspath(os.curdir),
|
||||
"XMLHttpRequest",
|
||||
"resources",
|
||||
auth = imp.load_source("", os.path.join(here,
|
||||
os.pardir,
|
||||
"authentication.py"))
|
||||
if request.method == "OPTIONS":
|
||||
return ""
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
import imp
|
||||
import os
|
||||
|
||||
here = os.path.dirname(__file__)
|
||||
|
||||
|
||||
def main(request, response):
|
||||
response.headers.set('Access-Control-Allow-Origin', request.headers.get("origin"));
|
||||
response.headers.set('Access-Control-Allow-Credentials', 'true');
|
||||
response.headers.set('Access-Control-Allow-Methods', 'GET');
|
||||
response.headers.set('Access-Control-Allow-Headers', 'x-user, x-pass');
|
||||
response.headers.set('Access-Control-Expose-Headers', 'x-challenge, xhr-user, ses-user');
|
||||
auth = imp.load_source("", os.path.join(os.path.abspath(os.curdir),
|
||||
"XMLHttpRequest",
|
||||
"resources",
|
||||
auth = imp.load_source("", os.path.join(here,
|
||||
os.pardir,
|
||||
"authentication.py"))
|
||||
if request.method == "OPTIONS":
|
||||
return ""
|
||||
|
|
|
@ -1,34 +1,63 @@
|
|||
// This simply posts a message to the owner page with the contents of the Referer header
|
||||
var xhr=new XMLHttpRequest()
|
||||
xhr.onreadystatechange = function(){
|
||||
if(xhr.readyState == 4){
|
||||
var obj = {test:'Referer header', result:xhr.responseText}
|
||||
self.postMessage(obj)
|
||||
}
|
||||
}
|
||||
xhr.open('GET', 'inspect-headers.py?filter_name=referer', true)
|
||||
xhr.send()
|
||||
importScripts("/resources/testharness.js")
|
||||
|
||||
// This simply posts a message to the owner page with the contents of the Origin header
|
||||
var xhr2=new XMLHttpRequest()
|
||||
xhr2.onreadystatechange = function(){
|
||||
if(xhr2.readyState == 4){
|
||||
var obj = {test:'Origin header', result:xhr2.responseText}
|
||||
self.postMessage(obj)
|
||||
}
|
||||
}
|
||||
xhr2.open('GET', location.protocol + '//www2.'+location.hostname+((location.port === "")?"":":"+location.port)+(location.pathname.replace(/[^/]*$/, ''))+'inspect-headers.py?filter_name=origin&cors', true)
|
||||
xhr2.send()
|
||||
async_test(function() {
|
||||
var expected = 'Referer: ' +
|
||||
location.href.replace(/[^/]*$/, '') +
|
||||
"workerxhr-origin-referrer.js\n"
|
||||
|
||||
// If "origin" / base URL is the origin of this JS file, we can load files
|
||||
// from the server it originates from.. and requri.py will be able to tell us
|
||||
// what the requested URL was
|
||||
var xhr3=new XMLHttpRequest()
|
||||
xhr3.onreadystatechange = function(){
|
||||
if(xhr3.readyState == 4){
|
||||
var obj = {test:'Request URL test', result:xhr3.responseText}
|
||||
self.postMessage(obj)
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.onreadystatechange = this.step_func(function() {
|
||||
if (xhr.readyState == 4) {
|
||||
assert_equals(xhr.responseText, expected)
|
||||
this.done()
|
||||
}
|
||||
}
|
||||
xhr3.open('GET', 'requri.py?full', true)
|
||||
xhr3.send()
|
||||
})
|
||||
xhr.open('GET', 'inspect-headers.py?filter_name=referer', true)
|
||||
xhr.send()
|
||||
}, 'Referer header')
|
||||
|
||||
async_test(function() {
|
||||
var expected = 'Origin: ' +
|
||||
location.protocol +
|
||||
'//' +
|
||||
location.hostname +
|
||||
(location.port === "" ? "" : ":" + location.port) +
|
||||
'\n'
|
||||
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.onreadystatechange = this.step_func(function() {
|
||||
if (xhr.readyState == 4) {
|
||||
assert_equals(xhr.responseText, expected)
|
||||
this.done()
|
||||
}
|
||||
})
|
||||
var url = location.protocol +
|
||||
'//www2.' +
|
||||
location.hostname +
|
||||
(location.port === "" ? "" : ":" + location.port) +
|
||||
location.pathname.replace(/[^/]*$/, '') +
|
||||
'inspect-headers.py?filter_name=origin&cors'
|
||||
xhr.open('GET', url, true)
|
||||
xhr.send()
|
||||
}, 'Origin header')
|
||||
|
||||
async_test(function() {
|
||||
// If "origin" / base URL is the origin of this JS file, we can load files
|
||||
// from the server it originates from.. and requri.py will be able to tell us
|
||||
// what the requested URL was
|
||||
|
||||
var expected = location.href.replace(/[^/]*$/, '') +
|
||||
'requri.py?full'
|
||||
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.onreadystatechange = this.step_func(function() {
|
||||
if (xhr.readyState == 4) {
|
||||
assert_equals(xhr.responseText, expected)
|
||||
this.done()
|
||||
}
|
||||
})
|
||||
xhr.open('GET', 'requri.py?full', true)
|
||||
xhr.send()
|
||||
}, 'Request URL test')
|
||||
|
||||
done()
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
var xhr=new XMLHttpRequest()
|
||||
xhr.onreadystatechange = function(){
|
||||
if(xhr.readyState == 4){
|
||||
|
|
|
@ -11,51 +11,82 @@
|
|||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var expectations = [
|
||||
{ contentType: 'application/xml;charset=UTF-8', responseText : '<\u00FF\/>' },
|
||||
{ contentType: 'text/html;charset=UTF-8', responseText : '<body>\uFFFD<\/body>' }, /*invalid character code in document turns into FFFD*/
|
||||
{ contentType: 'text/html;charset=UTF-8', responseText : '<body>\u30C6\u30b9\u30c8<\/body>' } /* correctly serialized Shift-JIS */,
|
||||
{ contentType: 'text/html;charset=UTF-8', responseText: 'top' }, /* There's some markup included, but it's not really relevant for this test suite, so we do an indexOf() test */
|
||||
{ contentType: 'text/html;charset=UTF-8' },
|
||||
{ contentType: 'text/html;charset=UTF-8', responseText: '<img>foo' },
|
||||
{ contentType: 'text/html;charset=UTF-8', responseText: '<!DOCTYPE html><html><head></head><body><div></div></body></html>' }
|
||||
]
|
||||
var tests = [
|
||||
{
|
||||
title: 'XML document, windows-1252',
|
||||
url: 'resources/win-1252-xml.py',
|
||||
contentType: 'application/xml;charset=UTF-8',
|
||||
responseText: '<\u00FF\/>'
|
||||
},
|
||||
// Invalid character code in document turns into U+FFFD.
|
||||
{
|
||||
title: 'HTML document, invalid UTF-8',
|
||||
url: 'resources/invalid-utf8-html.py',
|
||||
contentType: 'text/html;charset=UTF-8',
|
||||
responseText: '<body>\uFFFD<\/body>'
|
||||
},
|
||||
// Correctly serialized Shift-JIS.
|
||||
{
|
||||
title: 'HTML document, shift-jis',
|
||||
url: 'resources/shift-jis-html.py',
|
||||
contentType: 'text/html;charset=UTF-8',
|
||||
responseText: '<body>\u30C6\u30b9\u30c8<\/body>'
|
||||
},
|
||||
// There's some markup included, but it's not really relevant for this
|
||||
// test suite, so we do an indexOf() test.
|
||||
{
|
||||
title: 'plain text file',
|
||||
url: 'folder.txt',
|
||||
contentType: 'text/html;charset=UTF-8',
|
||||
responseText: 'top'
|
||||
},
|
||||
// This test does not want to assert anything about what markup a
|
||||
// standalone image should be wrapped in. Hence this test lacks a
|
||||
// responseText expectation.
|
||||
{
|
||||
title: 'image file',
|
||||
url: 'resources/image.gif',
|
||||
contentType: 'text/html;charset=UTF-8'
|
||||
},
|
||||
{
|
||||
title: 'img tag',
|
||||
url: 'resources/img-utf8-html.py',
|
||||
contentType: 'text/html;charset=UTF-8',
|
||||
responseText: '<img>foo'
|
||||
},
|
||||
{
|
||||
title: 'empty div',
|
||||
url: 'resources/empty-div-utf8-html.py',
|
||||
contentType: 'text/html;charset=UTF-8',
|
||||
responseText: '<!DOCTYPE html><html><head></head><body><div></div></body></html>'
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
function request(input, number, title) {
|
||||
test(function() {
|
||||
tests.forEach(function(t) {
|
||||
async_test(function() {
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.onload = this.step_func_done(function() {
|
||||
var client = new XMLHttpRequest()
|
||||
client.open("POST", "resources/content.py?response_charset_label=UTF-8", false)
|
||||
client.send(input)
|
||||
var exp = expectations[number]
|
||||
assert_equals(client.getResponseHeader('X-Request-Content-Type'), exp.contentType, 'document should be serialized and sent as '+exp.contentType+' (TEST#'+number+')')
|
||||
// The indexOf() assertation will overlook some stuff, i.e. XML prologues that shouldn't be there (looking at you, Presto).
|
||||
// However, arguably these things have little to do with the XHR functionality we're testing.
|
||||
if(exp.responseText){ // This test does not want to assert anything about what markup a standalone IMG should be wrapped in. Hence the GIF test lacks a responseText expectation.
|
||||
assert_true(client.responseText.indexOf(exp.responseText) != -1,
|
||||
JSON.stringify(exp.responseText) + " not in " +
|
||||
client.send(iframe.contentDocument)
|
||||
assert_equals(client.getResponseHeader('X-Request-Content-Type'),
|
||||
t.contentType,
|
||||
'document should be serialized and sent as ' + t.contentType)
|
||||
// The indexOf() assertion will overlook some stuff, e.g. XML
|
||||
// prologues that shouldn't be there (looking at you, Presto).
|
||||
// However, arguably these things have little to do with the XHR
|
||||
// functionality we're testing.
|
||||
if (t.responseText) {
|
||||
assert_true(client.responseText.indexOf(t.responseText) != -1,
|
||||
JSON.stringify(t.responseText) + " not in " +
|
||||
JSON.stringify(client.responseText));
|
||||
}
|
||||
assert_equals(client.responseXML, null)
|
||||
}, title)
|
||||
}
|
||||
function init(fr, number, title) { request(fr.contentDocument, number, title) }
|
||||
});
|
||||
iframe.src = t.url;
|
||||
document.body.appendChild(iframe);
|
||||
}, t.title);
|
||||
});
|
||||
</script>
|
||||
<!--
|
||||
This test also tests how documents in various encodings are serialized.
|
||||
The below IFRAMEs contain:
|
||||
* one XML document parsed from a windows-1252 source - content is <ÿ/>
|
||||
* one HTML-document parsed from an invalid UTF-8 source, will contain a basic HTML DOM
|
||||
with a U+FFFD replacement character for the invalid char
|
||||
* one HTML document parsed from a valid Shift-JIS source
|
||||
-->
|
||||
<iframe src='resources/win-1252-xml.py' onload="init(this, 0, 'XML document, windows-1252')"></iframe>
|
||||
<iframe src='resources/invalid-utf8-html.py' onload="init(this, 1, 'HTML document, invalid UTF-8')"></iframe>
|
||||
<iframe src='resources/shift-jis-html.py' onload="init(this, 2, 'HTML document, shift-jis')"></iframe>
|
||||
<iframe src='folder.txt' onload="init(this, 3, 'plain text file')"></iframe>
|
||||
<iframe src='resources/image.gif' onload="init(this, 4, 'image file')"></iframe>
|
||||
<iframe src='resources/img-utf8-html.py' onload="init(this, 5, 'img tag')"></iframe>
|
||||
<iframe src='resources/empty-div-utf8-html.py' onload="init(this, 6, 'empty div')"></iframe>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -18,6 +18,17 @@
|
|||
client.send(null)
|
||||
assert_equals(client.responseText, "x-test,")
|
||||
})
|
||||
|
||||
test(() => {
|
||||
const client = new XMLHttpRequest
|
||||
client.open("GET", "resources/echo-headers.py", false)
|
||||
client.setRequestHeader("THIS-IS-A-TEST", "1")
|
||||
client.setRequestHeader("THIS-is-A-test", "2")
|
||||
client.setRequestHeader("content-TYPE", "x/x")
|
||||
client.send()
|
||||
assert_regexp_match(client.responseText, /content-TYPE/)
|
||||
assert_regexp_match(client.responseText, /THIS-IS-A-TEST: 1, 2/)
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -17,15 +17,16 @@
|
|||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
var test = async_test();
|
||||
|
||||
function startRequest() {
|
||||
xhr.open("GET", "./resources/content.py?content=Hi", true);
|
||||
xhr.timeout = 2000;
|
||||
setTimeout(function () {
|
||||
test.step_timeout(function () {
|
||||
xhr.send();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
var test = async_test();
|
||||
test.step(function()
|
||||
{
|
||||
var count = 0;
|
||||
|
@ -40,7 +41,7 @@ test.step(function()
|
|||
assert_unreached("HTTP error should not timeout");
|
||||
}
|
||||
startRequest();
|
||||
setTimeout(startRequest, 3500);
|
||||
test.step_timeout(startRequest, 3500);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -78,6 +78,7 @@ dictionary SecurityPolicyViolationEventInit : EventInit {
|
|||
};
|
||||
|
||||
[
|
||||
Constructor(),
|
||||
CheckSecurity=Receiver,
|
||||
Exposed=(Window,Worker),
|
||||
ImmutablePrototype
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: Basic tests for cookieStore</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite();
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: Basic tests for cookieStore (HTTPS)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite();
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: Basic tests for cookieStore (Static)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite();
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: Basic tests for cookieStore (Static; HTTPS)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite();
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: delete cookies</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testDeleteCookies'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: delete cookies (HTTPS)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testDeleteCookies'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: delete cookies (Static)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testDeleteCookies'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: delete cookies (Static; HTTPS)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testDeleteCookies'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: document.cookie</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testDocumentCookie'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: document.cookie (HTTPS)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testDocumentCookie'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: document.cookie (Static)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testDocumentCookie'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: document.cookie (Static; HTTPS)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testDocumentCookie'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: expiration</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testExpiration'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: expiration (HTTPS)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testExpiration'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: expiration (Static)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testExpiration'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: expiration (Static; HTTPS)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testExpiration'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: get, set, getAll</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testGetSetGetAll'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: get, set, getAll (HTTPS)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testGetSetGetAll'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: get, set, getAll (Static)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testGetSetGetAll'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: get, set, getAll (Static; HTTPS)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testGetSetGetAll'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: HTTP Cookie and Set-Cookie headers</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testHttpCookieAndSetCookieHeaders'});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<title>Async Cookies: HTTP Cookie and Set-Cookie headers (HTTPS)</title>
|
||||
<meta name="help" href="https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/testharness-helpers.js"></script>
|
||||
<script src="resources/cookie-store-tests.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
suite({testName: 'testHttpCookieAndSetCookieHeaders'});
|
||||
</script>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue