diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini deleted file mode 100644 index 4bfb0c2053a..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[hit-test-floats-004.html] - [Miss float below something else] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini new file mode 100644 index 00000000000..baa9f1a7541 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini @@ -0,0 +1,4 @@ +[hit-test-floats-005.html] + [Miss clipped float] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/css-flexbox/percentage-max-height-003.html.ini b/tests/wpt/metadata-layout-2020/css/css-flexbox/percentage-max-height-003.html.ini new file mode 100644 index 00000000000..ad29758b4ed --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-flexbox/percentage-max-height-003.html.ini @@ -0,0 +1,2 @@ +[percentage-max-height-003.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini deleted file mode 100644 index 4c79907309b..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[CaretPosition-001.html] - [Element at (400, 100)] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPosition.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPosition.html.ini index a19f427ef6e..c131078eace 100644 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPosition.html.ini +++ b/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPosition.html.ini @@ -14,6 +14,6 @@ [test some point of the element: bottom right corner] expected: FAIL - [test some point of the element: top left corner] + [test the top of layer] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/custom-elements/reactions/HTMLMediaElement.html.ini b/tests/wpt/metadata-layout-2020/custom-elements/reactions/HTMLMediaElement.html.ini new file mode 100644 index 00000000000..2ca05f57bb0 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/custom-elements/reactions/HTMLMediaElement.html.ini @@ -0,0 +1,2 @@ +[HTMLMediaElement.html] + expected: TIMEOUT diff --git a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini index a128da41633..32d0ea8d301 100644 --- a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini +++ b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini @@ -315,15 +315,24 @@ [ + + diff --git a/tests/wpt/web-platform-tests/fetch/api/resources/bad-chunk-encoding.py b/tests/wpt/web-platform-tests/fetch/api/resources/bad-chunk-encoding.py index 23c7b3f47c4..94a77adead8 100644 --- a/tests/wpt/web-platform-tests/fetch/api/resources/bad-chunk-encoding.py +++ b/tests/wpt/web-platform-tests/fetch/api/resources/bad-chunk-encoding.py @@ -1,13 +1,13 @@ import time def main(request, response): - delay = float(request.GET.first("ms", 1000)) / 1E3 - count = int(request.GET.first("count", 50)) + delay = float(request.GET.first(b"ms", 1000)) / 1E3 + count = int(request.GET.first(b"count", 50)) time.sleep(delay) - response.headers.set("Transfer-Encoding", "chunked") + response.headers.set(b"Transfer-Encoding", b"chunked") response.write_status_headers() time.sleep(delay) - for i in xrange(count): - response.writer.write_content("a\r\nTEST_CHUNK\r\n") + for i in range(count): + response.writer.write_content(b"a\r\nTEST_CHUNK\r\n") time.sleep(delay) - response.writer.write_content("garbage") + response.writer.write_content(b"garbage") diff --git a/tests/wpt/web-platform-tests/fetch/api/resources/echo-content.py b/tests/wpt/web-platform-tests/fetch/api/resources/echo-content.py index 9a038f329c8..5e137e15d7d 100644 --- a/tests/wpt/web-platform-tests/fetch/api/resources/echo-content.py +++ b/tests/wpt/web-platform-tests/fetch/api/resources/echo-content.py @@ -1,10 +1,12 @@ +from wptserve.utils import isomorphic_encode + def main(request, response): - headers = [("X-Request-Method", request.method), - ("X-Request-Content-Length", request.headers.get("Content-Length", "NO")), - ("X-Request-Content-Type", request.headers.get("Content-Type", "NO")), + headers = [(b"X-Request-Method", isomorphic_encode(request.method)), + (b"X-Request-Content-Length", request.headers.get(b"Content-Length", b"NO")), + (b"X-Request-Content-Type", request.headers.get(b"Content-Type", b"NO")), # Avoid any kind of content sniffing on the response. - ("Content-Type", "text/plain")] + (b"Content-Type", b"text/plain")] content = request.body return headers, content diff --git a/tests/wpt/web-platform-tests/fetch/api/resources/redirect-empty-location.py b/tests/wpt/web-platform-tests/fetch/api/resources/redirect-empty-location.py index 2baabae03b0..1a5f7feb2a4 100644 --- a/tests/wpt/web-platform-tests/fetch/api/resources/redirect-empty-location.py +++ b/tests/wpt/web-platform-tests/fetch/api/resources/redirect-empty-location.py @@ -1,3 +1,3 @@ def main(request, response): - headers = [("Location", "")] - return 302, headers, "" + headers = [(b"Location", b"")] + return 302, headers, b"" diff --git a/tests/wpt/web-platform-tests/fetch/api/resources/script-with-header.py b/tests/wpt/web-platform-tests/fetch/api/resources/script-with-header.py index 5337cc97bdd..9a9c70ef5cf 100644 --- a/tests/wpt/web-platform-tests/fetch/api/resources/script-with-header.py +++ b/tests/wpt/web-platform-tests/fetch/api/resources/script-with-header.py @@ -1,7 +1,7 @@ def main(request, response): - headers = [("Content-type", request.GET.first("mime"))] - if "content" in request.GET and request.GET.first("content") == "empty": - content = '' + headers = [(b"Content-type", request.GET.first(b"mime"))] + if b"content" in request.GET and request.GET.first(b"content") == b"empty": + content = b'' else: - content = "console.log('Script loaded')" + content = b"console.log('Script loaded')" return 200, headers, content diff --git a/tests/wpt/web-platform-tests/fetch/api/resources/status.py b/tests/wpt/web-platform-tests/fetch/api/resources/status.py index 5d72e10b24b..05a59d5a637 100644 --- a/tests/wpt/web-platform-tests/fetch/api/resources/status.py +++ b/tests/wpt/web-platform-tests/fetch/api/resources/status.py @@ -1,9 +1,11 @@ +from wptserve.utils import isomorphic_encode + def main(request, response): - code = int(request.GET.first("code", 200)) - text = request.GET.first("text", "OMG") - content = request.GET.first("content", "") - type = request.GET.first("type", "") + code = int(request.GET.first(b"code", 200)) + text = request.GET.first(b"text", b"OMG") + content = request.GET.first(b"content", b"") + type = request.GET.first(b"type", b"") status = (code, text) - headers = [("Content-Type", type), - ("X-Request-Method", request.method)] + headers = [(b"Content-Type", type), + (b"X-Request-Method", isomorphic_encode(request.method))] return status, headers, content diff --git a/tests/wpt/web-platform-tests/fetch/h1-parsing/resources/document-with-0x00-in-header.py b/tests/wpt/web-platform-tests/fetch/h1-parsing/resources/document-with-0x00-in-header.py index 6e8db619591..223b3c40278 100644 --- a/tests/wpt/web-platform-tests/fetch/h1-parsing/resources/document-with-0x00-in-header.py +++ b/tests/wpt/web-platform-tests/fetch/h1-parsing/resources/document-with-0x00-in-header.py @@ -1,4 +1,4 @@ def main(request, response): - response.headers.set("Content-Type", "text/html") - response.headers.set("Custom", "\0") - return "This is a document." + response.headers.set(b"Content-Type", b"text/html") + response.headers.set(b"Custom", b"\0") + return b"This is a document." diff --git a/tests/wpt/web-platform-tests/fetch/h1-parsing/resources/script-with-0x00-in-header.py b/tests/wpt/web-platform-tests/fetch/h1-parsing/resources/script-with-0x00-in-header.py index f4a016a3698..39f58d8270e 100644 --- a/tests/wpt/web-platform-tests/fetch/h1-parsing/resources/script-with-0x00-in-header.py +++ b/tests/wpt/web-platform-tests/fetch/h1-parsing/resources/script-with-0x00-in-header.py @@ -1,4 +1,4 @@ def main(request, response): - response.headers.set("Content-Type", "text/javascript") - response.headers.set("Custom", "\0") - return "var thisIsJavaScript = 0" + response.headers.set(b"Content-Type", b"text/javascript") + response.headers.set(b"Custom", b"\0") + return b"var thisIsJavaScript = 0" diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getEntries-manual.https.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-iteration-manual.https.html similarity index 82% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getEntries-manual.https.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-iteration-manual.https.html index 858bf02f1fa..10d891098de 100644 --- a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getEntries-manual.https.html +++ b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-iteration-manual.https.html @@ -7,4 +7,4 @@ - + diff --git a/tests/wpt/web-platform-tests/native-file-system/resources/messaging-serialize-helpers.js b/tests/wpt/web-platform-tests/native-file-system/resources/messaging-serialize-helpers.js index b4d41aa91c0..3ef347f98fe 100644 --- a/tests/wpt/web-platform-tests/native-file-system/resources/messaging-serialize-helpers.js +++ b/tests/wpt/web-platform-tests/native-file-system/resources/messaging-serialize-helpers.js @@ -77,7 +77,7 @@ async function serialize_file_system_directory_handle(directory_handle) { // Serialize the contents of the directory. const serialized_files = []; const serialized_directories = []; - for await (const child_handle of directory_handle.getEntries()) { + for await (const child_handle of directory_handle.values()) { const serialized_child_handle = await serialize_handle(child_handle); if (child_handle.kind === "directory") { serialized_directories.push(serialized_child_handle); diff --git a/tests/wpt/web-platform-tests/native-file-system/resources/native-fs-test-helpers.js b/tests/wpt/web-platform-tests/native-file-system/resources/native-fs-test-helpers.js index 231bc067532..cd1613eae5d 100644 --- a/tests/wpt/web-platform-tests/native-file-system/resources/native-fs-test-helpers.js +++ b/tests/wpt/web-platform-tests/native-file-system/resources/native-fs-test-helpers.js @@ -21,7 +21,7 @@ const directory_promise = (async () => { const entries = await self.showDirectoryPicker(); assert_true(entries instanceof FileSystemHandle); assert_true(entries instanceof FileSystemDirectoryHandle); - for await (const entry of entries.getEntries()) { + for await (const entry of entries) { assert_unreached('Selected directory is not empty'); } return entries; @@ -32,7 +32,7 @@ function directory_test(func, description) { const directory = await directory_promise; // To be resilient against tests not cleaning up properly, cleanup before // every test. - for await (let entry of directory.getEntries()) { + for await (let entry of directory.values()) { await directory.removeEntry( entry.name, {recursive: entry.kind === 'directory'}); } diff --git a/tests/wpt/web-platform-tests/native-file-system/resources/sandboxed-fs-test-helpers.js b/tests/wpt/web-platform-tests/native-file-system/resources/sandboxed-fs-test-helpers.js index 1b27445e951..e3c18dbecec 100644 --- a/tests/wpt/web-platform-tests/native-file-system/resources/sandboxed-fs-test-helpers.js +++ b/tests/wpt/web-platform-tests/native-file-system/resources/sandboxed-fs-test-helpers.js @@ -9,7 +9,7 @@ async function cleanupSandboxedFileSystem() { const dir = await self.getOriginPrivateDirectory(); - for await (let entry of dir.getEntries()) + for await (let entry of dir.values()) await dir.removeEntry(entry.name, {recursive: entry.kind === 'directory'}); } diff --git a/tests/wpt/web-platform-tests/native-file-system/resources/test-helpers.js b/tests/wpt/web-platform-tests/native-file-system/resources/test-helpers.js index 0d8bdfde8d7..27469349cde 100644 --- a/tests/wpt/web-platform-tests/native-file-system/resources/test-helpers.js +++ b/tests/wpt/web-platform-tests/native-file-system/resources/test-helpers.js @@ -25,7 +25,7 @@ async function getFileContents(handle) { async function getDirectoryEntryCount(handle) { let result = 0; - for await (let entry of handle.getEntries()) { + for await (let entry of handle) { result++; } return result; @@ -33,7 +33,7 @@ async function getDirectoryEntryCount(handle) { async function getSortedDirectoryEntries(handle) { let result = []; - for await (let entry of handle.getEntries()) { + for await (let entry of handle.values()) { if (entry.kind === 'directory') result.push(entry.name + '/'); else diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getEntries.https.any.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-iteration.https.any.js similarity index 58% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getEntries.https.any.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-iteration.https.any.js index da620e2a3b1..3961ea3ea86 100644 --- a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getEntries.https.any.js +++ b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-iteration.https.any.js @@ -1,3 +1,3 @@ // META: script=resources/test-helpers.js // META: script=resources/sandboxed-fs-test-helpers.js -// META: script=script-tests/FileSystemDirectoryHandle-getEntries.js +// META: script=script-tests/FileSystemDirectoryHandle-iteration.js diff --git a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getEntries.js b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getEntries.js deleted file mode 100644 index 571683ccfd1..00000000000 --- a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getEntries.js +++ /dev/null @@ -1,41 +0,0 @@ -directory_test(async (t, root) => { - const file_name1 = 'foo1.txt'; - const file_name2 = 'foo2.txt'; - await createFileWithContents(t, file_name1, 'contents', /*parent=*/ root); - await createFileWithContents(t, file_name2, 'contents', /*parent=*/ root); - - let abortIter = async (dir) => { - for await (let entry of dir.getEntries()) { - return entry.name; - } - }; - - try { - await abortIter(root); - } catch(e) { - assert_unreached('Error thrown on iteration abort.'); - } - -}, 'getEntries(): returning early from an iteration works'); - -directory_test(async (t, root) => { - const file_name1 = 'foo1.txt'; - const file_name2 = 'foo2.txt'; - await createFileWithContents(t, file_name1, 'contents', /*parent=*/ root); - await createFileWithContents(t, file_name2, 'contents', /*parent=*/ root); - - let fullIter = async (dir) => { - let name; - for await (let entry of dir.getEntries()) { - name = entry.name; - } - return name; - }; - - try { - await fullIter(root); - } catch(e) { - assert_unreached('Error thrown on iteration.'); - } - -}, 'getEntries(): full iteration works'); diff --git a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-iteration.js b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-iteration.js new file mode 100644 index 00000000000..200f5af65f5 --- /dev/null +++ b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-iteration.js @@ -0,0 +1,80 @@ +directory_test(async (t, root) => { + const file_name1 = 'foo1.txt'; + const file_name2 = 'foo2.txt'; + await createFileWithContents(t, file_name1, 'contents', /*parent=*/ root); + await createFileWithContents(t, file_name2, 'contents', /*parent=*/ root); + + for await (let entry of root) { + break; + } + +}, 'returning early from an iteration doesn\'t crash'); + +directory_test(async (t, root) => { + const file_name1 = 'foo1.txt'; + const file_name2 = 'foo2.txt'; + await createFileWithContents(t, file_name1, 'contents', /*parent=*/ root); + await createFileWithContents(t, file_name2, 'contents', /*parent=*/ root); + + let names = []; + for await (let entry of root) { + assert_true(Array.isArray(entry)); + assert_equals(entry.length, 2); + assert_equals(typeof entry[0], 'string'); + assert_true(entry[1] instanceof FileSystemFileHandle); + assert_equals(entry[0], entry[1].name); + names.push(entry[0]); + } + names.sort(); + assert_array_equals(names, [file_name1, file_name2]); + +}, '@@asyncIterator: full iteration works'); + +directory_test(async (t, root) => { + const file_name1 = 'foo1.txt'; + const file_name2 = 'foo2.txt'; + await createFileWithContents(t, file_name1, 'contents', /*parent=*/ root); + await createFileWithContents(t, file_name2, 'contents', /*parent=*/ root); + + let names = []; + for await (let entry of root.entries()) { + assert_true(Array.isArray(entry)); + assert_equals(entry.length, 2); + assert_equals(typeof entry[0], 'string'); + assert_true(entry[1] instanceof FileSystemFileHandle); + assert_equals(entry[0], entry[1].name); + names.push(entry[0]); + } + names.sort(); + assert_array_equals(names, [file_name1, file_name2]); +}, 'entries: full iteration works'); + +directory_test(async (t, root) => { + const file_name1 = 'foo1.txt'; + const file_name2 = 'foo2.txt'; + await createFileWithContents(t, file_name1, 'contents', /*parent=*/ root); + await createFileWithContents(t, file_name2, 'contents', /*parent=*/ root); + + let names = []; + for await (let entry of root.values()) { + assert_true(entry instanceof FileSystemFileHandle); + names.push(entry.name); + } + names.sort(); + assert_array_equals(names, [file_name1, file_name2]); +}, 'values: full iteration works'); + +directory_test(async (t, root) => { + const file_name1 = 'foo1.txt'; + const file_name2 = 'foo2.txt'; + await createFileWithContents(t, file_name1, 'contents', /*parent=*/ root); + await createFileWithContents(t, file_name2, 'contents', /*parent=*/ root); + + let names = []; + for await (let entry of root.keys()) { + assert_equals(typeof entry, 'string'); + names.push(entry); + } + names.sort(); + assert_array_equals(names, [file_name1, file_name2]); +}, 'keys: full iteration works'); diff --git a/tests/wpt/web-platform-tests/native-io/rename_async_failure_handling.tentative.https.any.js b/tests/wpt/web-platform-tests/native-io/rename_async_failure_handling.tentative.https.any.js index 5e0f96408bb..64ea24fa65e 100644 --- a/tests/wpt/web-platform-tests/native-io/rename_async_failure_handling.tentative.https.any.js +++ b/tests/wpt/web-platform-tests/native-io/rename_async_failure_handling.tentative.https.any.js @@ -93,8 +93,8 @@ promise_test(async testCase => { closed_file.close(); const opened_file = await nativeIO.open('opened_file'); testCase.add_cleanup(async () => { - closed_file.close(); - opened_file.close(); + await closed_file.close(); + await opened_file.close(); await nativeIO.delete('closed_file'); await nativeIO.delete('opened_file'); }); diff --git a/tests/wpt/web-platform-tests/pointerevents/pointerevent_tiltX_tiltY_to_azimuth_altitude.html b/tests/wpt/web-platform-tests/pointerevents/pointerevent_tiltX_tiltY_to_azimuth_altitude.html new file mode 100644 index 00000000000..4521c247d15 --- /dev/null +++ b/tests/wpt/web-platform-tests/pointerevents/pointerevent_tiltX_tiltY_to_azimuth_altitude.html @@ -0,0 +1,109 @@ + + + + TiltX/TiltY to Azimuth/Altitude + + + + + + + diff --git a/tests/wpt/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-02.svg b/tests/wpt/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-02.svg index 4cf93da6a18..9420503d404 100644 --- a/tests/wpt/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-02.svg +++ b/tests/wpt/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-02.svg @@ -1,13 +1,12 @@ SVGGeometryElement.prototype.getPointAtLength() query with 'pathLength' + diff --git a/tests/wpt/web-platform-tests/web-nfc/NDEFReader_scan_filter.https.html b/tests/wpt/web-platform-tests/web-nfc/NDEFReader_scan_filter.https.html index ddb25b87e14..1fea2437b93 100644 --- a/tests/wpt/web-platform-tests/web-nfc/NDEFReader_scan_filter.https.html +++ b/tests/wpt/web-platform-tests/web-nfc/NDEFReader_scan_filter.https.html @@ -162,79 +162,4 @@ for (let multiMessagesTest of multiMessagesTests) { ); } -nfc_test(async (t, mockNFC) => { - const reader = new NDEFReader(); - const controller = new AbortController(); - const signal = controller.signal; - const textMsg = createMessage([createTextRecord(test_text_data)]); - const urlMsg = createMessage([createUrlRecord(test_url_data)]); - const mimeMsg = createMessage([createMimeRecord(test_buffer_data)]); - - const readerWatcher = new EventWatcher(t, reader, ["reading", "error"]); - const promise = readerWatcher.wait_for("reading").then(event => { - controller.abort(); - assertWebNDEFMessagesEqual(event.message, new NDEFMessage(mimeMsg)); - }); - - const scanOptions1 = {recordType: "text", signal: signal}; - const scanOptions2 = {recordType: "url", signal: signal}; - const scanOptions3 = {recordType: "mime", signal: signal}; - - await reader.scan(scanOptions1); - await reader.scan(scanOptions2); - // There is maximum one filter for an NDEFReader object, - // last filter will replace all previous ones. - await reader.scan(scanOptions3); - - mockNFC.setReadingMessage(textMsg); - mockNFC.setReadingMessage(urlMsg); - mockNFC.setReadingMessage(mimeMsg); - await promise; -}, "Multiple scan() from the same NDEFReader object with new options should \ -replace existing filters."); - -nfc_test(async (t, mockNFC) => { - const reader = new NDEFReader(); - const controller1 = new AbortController(); - const controller2 = new AbortController(); - const urlMsg = createMessage([createUrlRecord(test_url_data)]); - const mimeMsg = createMessage([createMimeRecord(test_buffer_data)]); - - const readerWatcher = new EventWatcher(t, reader, ["reading", "error"]); - const promise = readerWatcher.wait_for("reading").then(event => { - assertWebNDEFMessagesEqual(event.message, new NDEFMessage(mimeMsg)); - controller2.abort(); - }); - - const scanOptions1 = {recordType: "url", signal: controller1.signal}; - const scanOptions2 = {recordType: "mime", signal: controller2.signal}; - - // There is maximum one filter for an NDEFReader object, - // last filter will replace all previous ones. - await reader.scan(scanOptions1); - await reader.scan(scanOptions2); - - mockNFC.setReadingMessage(urlMsg); - - controller1.abort(); - - mockNFC.setReadingMessage(mimeMsg); - await promise; -}, "Aborting on previous signal should not stop current reading for multiple \ -scan() with different signals."); - -nfc_test(async (t, mockNFC) => { - const reader = new NDEFReader(); - const controller = new AbortController(); - const scanOptions1 = {recordType: "url", signal: controller.signal }; - const scanOptions2 = {recordType: "mime"}; - - await reader.scan(scanOptions1); - const promise = reader.scan(scanOptions2); - controller.abort(); - - await promise_rejects_dom(t, 'AbortError', promise); -}, "Aborting on previous signal can stop current reading if no new signals \ -passed to successive scan()."); - diff --git a/tests/wpt/web-platform-tests/xhr/access-control-basic-cors-safelisted-response-headers.htm b/tests/wpt/web-platform-tests/xhr/access-control-basic-cors-safelisted-response-headers.htm index a5c470b74f5..be9a10ef016 100644 --- a/tests/wpt/web-platform-tests/xhr/access-control-basic-cors-safelisted-response-headers.htm +++ b/tests/wpt/web-platform-tests/xhr/access-control-basic-cors-safelisted-response-headers.htm @@ -12,7 +12,7 @@ const xhr = new XMLHttpRequest; xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/xhr/resources/access-control-basic-whitelist-response-headers.py", false); + "/xhr/resources/access-control-basic-cors-safelisted-response-headers.py", false); xhr.send(); assert_not_equals(xhr.getResponseHeader("cache-control"), null); diff --git a/tests/wpt/web-platform-tests/xhr/resources/access-control-basic-whitelist-response-headers.py b/tests/wpt/web-platform-tests/xhr/resources/access-control-basic-cors-safelisted-response-headers.py similarity index 100% rename from tests/wpt/web-platform-tests/xhr/resources/access-control-basic-whitelist-response-headers.py rename to tests/wpt/web-platform-tests/xhr/resources/access-control-basic-cors-safelisted-response-headers.py diff --git a/tests/wpt/web-platform-tests/xhr/resources/invalid-utf8-html.py b/tests/wpt/web-platform-tests/xhr/resources/invalid-utf8-html.py index c15d17151a1..1c0cd84f42f 100644 --- a/tests/wpt/web-platform-tests/xhr/resources/invalid-utf8-html.py +++ b/tests/wpt/web-platform-tests/xhr/resources/invalid-utf8-html.py @@ -1,5 +1,7 @@ +from six import int2byte + def main(request, response): headers = [(b"Content-type", b"text/html;charset=utf-8")] - content = chr(0xff) + content = int2byte(0xff) return headers, content diff --git a/tests/wpt/web-platform-tests/xhr/resources/shift-jis-html.py b/tests/wpt/web-platform-tests/xhr/resources/shift-jis-html.py index 47c67d8ae39..b3326c1ba7b 100644 --- a/tests/wpt/web-platform-tests/xhr/resources/shift-jis-html.py +++ b/tests/wpt/web-platform-tests/xhr/resources/shift-jis-html.py @@ -1,6 +1,8 @@ +from six import int2byte + def main(request, response): headers = [(b"Content-type", b"text/html;charset=shift-jis")] # Shift-JIS bytes for katakana TE SU TO ('test') - content = chr(0x83) + chr(0x65) + chr(0x83) + chr(0x58) + chr(0x83) + chr(0x67) + content = int2byte(0x83) + int2byte(0x65) + int2byte(0x83) + int2byte(0x58) + int2byte(0x83) + int2byte(0x67) return headers, content diff --git a/tests/wpt/web-platform-tests/xhr/resources/win-1252-xml.py b/tests/wpt/web-platform-tests/xhr/resources/win-1252-xml.py index d88086e936e..50e9f04fb8d 100644 --- a/tests/wpt/web-platform-tests/xhr/resources/win-1252-xml.py +++ b/tests/wpt/web-platform-tests/xhr/resources/win-1252-xml.py @@ -1,5 +1,7 @@ +from six import int2byte + def main(request, response): headers = [(b"Content-type", b"application/xml;charset=windows-1252")] - content = '<' + chr(0xff) + '/>' + content = b'<' + int2byte(0xff) + b'/>' return headers, content