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/css-fonts/font-language-override-02.html.ini b/tests/wpt/metadata-layout-2020/css/css-fonts/font-language-override-02.html.ini new file mode 100644 index 00000000000..bdb09c516e4 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-fonts/font-language-override-02.html.ini @@ -0,0 +1,2 @@ +[font-language-override-02.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-transforms/transform-scale-hittest.html.ini b/tests/wpt/metadata-layout-2020/css/css-transforms/transform-scale-hittest.html.ini index 4a1e8110f6f..f8e7e539aae 100644 --- a/tests/wpt/metadata-layout-2020/css/css-transforms/transform-scale-hittest.html.ini +++ b/tests/wpt/metadata-layout-2020/css/css-transforms/transform-scale-hittest.html.ini @@ -2,3 +2,6 @@ [Hit test intersecting scaled box] expected: FAIL + [Hit test within unscaled box] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini deleted file mode 100644 index e181af5397f..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[elementsFromPoint-invalid-cases.html] - [The root element is the last element returned for otherwise empty queries within the viewport] - expected: FAIL - 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 ded78351c4b..2ece189c0b2 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 @@ -312,9 +312,6 @@ [Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK] expected: NOTRUN - [ + + + diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-audio-element/audio-play-in-inactive-document-crash.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-audio-element/audio-play-in-inactive-document-crash.html new file mode 100644 index 00000000000..ade40797b97 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-audio-element/audio-play-in-inactive-document-crash.html @@ -0,0 +1,8 @@ + + + diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/img-created-in-active-document-crash.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/img-created-in-active-document-crash.html new file mode 100644 index 00000000000..852375bff38 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/img-created-in-active-document-crash.html @@ -0,0 +1,6 @@ + + diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-video-element/video-import-to-inactive-document-crash.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-video-element/video-import-to-inactive-document-crash.html new file mode 100644 index 00000000000..1e14388efd3 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-video-element/video-import-to-inactive-document-crash.html @@ -0,0 +1,7 @@ + + + diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/form-submit-iframe-then-location-navigate.html b/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/form-submit-iframe-then-location-navigate.html new file mode 100644 index 00000000000..ad2943e2bb0 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/form-submit-iframe-then-location-navigate.html @@ -0,0 +1,23 @@ + + + + + + + + + + +
+ + diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/resources/form.html b/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/resources/form.html new file mode 100644 index 00000000000..8b16672d6b7 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/resources/form.html @@ -0,0 +1,4 @@ + + + form.html + diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/resources/location.html b/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/resources/location.html new file mode 100644 index 00000000000..6724189eff5 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/resources/location.html @@ -0,0 +1,4 @@ + + + location.html + diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/the-option-element/dynamic-content-change-rendering-ref.html b/tests/wpt/web-platform-tests/html/semantics/forms/the-option-element/dynamic-content-change-rendering-ref.html new file mode 100644 index 00000000000..453bb70822f --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/forms/the-option-element/dynamic-content-change-rendering-ref.html @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/the-option-element/dynamic-content-change-rendering.html b/tests/wpt/web-platform-tests/html/semantics/forms/the-option-element/dynamic-content-change-rendering.html new file mode 100644 index 00000000000..c0e08d2e48d --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/forms/the-option-element/dynamic-content-change-rendering.html @@ -0,0 +1,33 @@ + + +Invalidation test on resetting <select> + + + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout.html b/tests/wpt/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout.html index bdd28270d67..9e9f70d0976 100644 --- a/tests/wpt/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout.html +++ b/tests/wpt/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout.html @@ -46,10 +46,14 @@ function checkNotVerticallyCentered(dialog) { function checkVerticallyCentered(dialog) { var centeredTop = (window.innerHeight - dialog.offsetHeight) / 2; - assert_equals(dialog.getBoundingClientRect().top, centeredTop); + // Using approx equals because getBoundingClientRect() and centeredTop + // are calculated by different parts of the engine. Due to the loss + // of precision, the numbers might not equal exactly. + assert_approx_equals(dialog.getBoundingClientRect().top, centeredTop, 1); } function reset() { + document.body.style.width = "auto"; if (dialog.open) dialog.close(); dialog.remove(); @@ -127,8 +131,6 @@ test(function() { dialog.showModal(); checkVerticallyCentered(dialog); - // Set back original value to 'width'. - document.body.style.width = 'auto'; }, "The dialog should be centered regardless of the presence of a horizontal scrollbar."); test(function() { diff --git a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-element-clone-into-inactive-document-crash.html b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-element-clone-into-inactive-document-crash.html new file mode 100644 index 00000000000..56b199d1eb1 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-element-clone-into-inactive-document-crash.html @@ -0,0 +1,7 @@ + + + diff --git a/tests/wpt/web-platform-tests/html/syntax/parsing-html-fragments/tokenizer-modes-001.html b/tests/wpt/web-platform-tests/html/syntax/parsing-html-fragments/tokenizer-modes-001.html new file mode 100644 index 00000000000..d283274214b --- /dev/null +++ b/tests/wpt/web-platform-tests/html/syntax/parsing-html-fragments/tokenizer-modes-001.html @@ -0,0 +1,85 @@ + + + + Tokenizer states + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/infrastructure/testdriver/actions/pointerevent_pointermove_in_pointerlock.html.ini b/tests/wpt/web-platform-tests/infrastructure/testdriver/actions/pointerevent_pointermove_in_pointerlock.html.ini new file mode 100644 index 00000000000..0c21bf5b526 --- /dev/null +++ b/tests/wpt/web-platform-tests/infrastructure/testdriver/actions/pointerevent_pointermove_in_pointerlock.html.ini @@ -0,0 +1,3 @@ +[pointerevent_pointermove_in_pointerlock.html] + expected: + if product == "firefox": ERROR diff --git a/tests/wpt/web-platform-tests/interfaces/native-file-system.idl b/tests/wpt/web-platform-tests/interfaces/native-file-system.idl index f4679175c46..60a28f055de 100644 --- a/tests/wpt/web-platform-tests/interfaces/native-file-system.idl +++ b/tests/wpt/web-platform-tests/interfaces/native-file-system.idl @@ -13,18 +13,20 @@ interface FileSystemHandle { readonly attribute boolean isDirectory; readonly attribute USVString name; + Promise isSameEntry(FileSystemHandle other); + Promise queryPermission(optional FileSystemHandlePermissionDescriptor descriptor = {}); Promise requestPermission(optional FileSystemHandlePermissionDescriptor descriptor = {}); }; -dictionary FileSystemCreateWriterOptions { +dictionary FileSystemCreateWritableOptions { boolean keepExistingData = false; }; [Exposed=(Window,Worker), SecureContext, Serializable] interface FileSystemFileHandle : FileSystemHandle { Promise getFile(); - Promise createWriter(optional FileSystemCreateWriterOptions options = {}); + Promise createWritable(optional FileSystemCreateWritableOptions options = {}); }; dictionary FileSystemGetFileOptions { @@ -41,20 +43,36 @@ dictionary FileSystemRemoveOptions { [Exposed=(Window,Worker), SecureContext, Serializable] interface FileSystemDirectoryHandle : FileSystemHandle { + async iterable; + Promise getFile(USVString name, optional FileSystemGetFileOptions options = {}); Promise getDirectory(USVString name, optional FileSystemGetDirectoryOptions options = {}); - // This really returns an async iterable, but that is not yet expressable in WebIDL. - object getEntries(); - Promise removeEntry(USVString name, optional FileSystemRemoveOptions options = {}); + + Promise?> resolve(FileSystemHandle possibleDescendant); }; +enum WriteCommandType { + "write", + "seek", + "truncate", +}; + +dictionary WriteParams { + required WriteCommandType type; + unsigned long long? size; + unsigned long long? position; + (BufferSource or Blob or USVString)? data; +}; + +typedef (BufferSource or Blob or USVString or WriteParams) FileSystemWriteChunkType; + [Exposed=(Window,Worker), SecureContext] -interface FileSystemWriter { - Promise write(unsigned long long position, (BufferSource or Blob or USVString) data); +interface FileSystemWritableFileStream : WritableStream { + Promise write(FileSystemWriteChunkType data); + Promise seek(unsigned long long position); Promise truncate(unsigned long long size); - Promise close(); }; enum ChooseFileSystemEntriesType { "open-file", "save-file", "open-directory" }; @@ -78,15 +96,7 @@ partial interface Window { chooseFileSystemEntries(optional ChooseFileSystemEntriesOptions options = {}); }; -enum SystemDirectoryType { - "sandbox" -}; - -dictionary GetSystemDirectoryOptions { - required SystemDirectoryType type; -}; - [SecureContext] -partial interface FileSystemDirectoryHandle { - static Promise getSystemDirectory(GetSystemDirectoryOptions options); +partial interface mixin WindowOrWorkerGlobalScope { + Promise getOriginPrivateDirectory(); }; diff --git a/tests/wpt/web-platform-tests/interfaces/streams.idl b/tests/wpt/web-platform-tests/interfaces/streams.idl new file mode 100644 index 00000000000..4dddbf41cbf --- /dev/null +++ b/tests/wpt/web-platform-tests/interfaces/streams.idl @@ -0,0 +1,209 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into reffy-reports +// (https://github.com/tidoust/reffy-reports) +// Source: Streams Standard (https://streams.spec.whatwg.org/) + +[Exposed=(Window,Worker,Worklet)] +interface ReadableStream { + constructor(optional object underlyingSource, optional QueuingStrategy strategy = {}); + + readonly attribute boolean locked; + + Promise cancel(optional any reason); + ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options = {}); + ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {}); + Promise pipeTo(WritableStream destination, optional StreamPipeOptions options = {}); + sequence tee(); + + async iterable(optional ReadableStreamIteratorOptions options = {}); +}; + +typedef (ReadableStreamDefaultReader or ReadableStreamBYOBReader) ReadableStreamReader; + +enum ReadableStreamReaderMode { "byob" }; + +dictionary ReadableStreamGetReaderOptions { + ReadableStreamReaderMode mode; +}; + +dictionary ReadableStreamIteratorOptions { + boolean preventCancel = false; +}; + +dictionary ReadableWritablePair { + required ReadableStream readable; + required WritableStream writable; +}; + +dictionary StreamPipeOptions { + boolean preventClose = false; + boolean preventAbort = false; + boolean preventCancel = false; + AbortSignal signal; +}; + +dictionary UnderlyingSource { + UnderlyingSourceStartCallback start; + UnderlyingSourcePullCallback pull; + UnderlyingSourceCancelCallback cancel; + ReadableStreamType type; + [EnforceRange] unsigned long long autoAllocateChunkSize; +}; + +typedef (ReadableStreamDefaultController or ReadableByteStreamController) ReadableStreamController; + +callback UnderlyingSourceStartCallback = any (ReadableStreamController controller); +callback UnderlyingSourcePullCallback = Promise (ReadableStreamController controller); +callback UnderlyingSourceCancelCallback = Promise (optional any reason); + +enum ReadableStreamType { "bytes" }; + +[Exposed=(Window,Worker,Worklet)] +interface ReadableStreamDefaultReader { + constructor(ReadableStream stream); + + readonly attribute Promise closed; + + Promise cancel(optional any reason); + Promise read(); + void releaseLock(); +}; + +[Exposed=(Window,Worker,Worklet)] +interface ReadableStreamBYOBReader { + constructor(ReadableStream stream); + + readonly attribute Promise closed; + + Promise cancel(optional any reason); + Promise read(ArrayBufferView view); + void releaseLock(); +}; + +[Exposed=(Window,Worker,Worklet)] +interface ReadableStreamDefaultController { + readonly attribute unrestricted double? desiredSize; + + void close(); + void enqueue(optional any chunk); + void error(optional any e); +}; + +[Exposed=(Window,Worker,Worklet)] +interface ReadableByteStreamController { + readonly attribute ReadableStreamBYOBRequest? byobRequest; + readonly attribute unrestricted double? desiredSize; + + void close(); + void enqueue(ArrayBufferView chunk); + void error(optional any e); +}; + +[Exposed=(Window,Worker,Worklet)] +interface ReadableStreamBYOBRequest { + readonly attribute ArrayBufferView? view; + + void respond([EnforceRange] unsigned long long bytesWritten); + void respondWithNewView(ArrayBufferView view); +}; + +[Exposed=(Window,Worker,Worklet)] +interface WritableStream { + constructor(optional object underlyingSink, optional QueuingStrategy strategy = {}); + + readonly attribute boolean locked; + + Promise abort(optional any reason); + Promise close(); + WritableStreamDefaultWriter getWriter(); +}; + +dictionary UnderlyingSink { + UnderlyingSinkStartCallback start; + UnderlyingSinkWriteCallback write; + UnderlyingSinkCloseCallback close; + UnderlyingSinkAbortCallback abort; + any type; +}; + +callback UnderlyingSinkStartCallback = any (WritableStreamDefaultController controller); +callback UnderlyingSinkWriteCallback = Promise (WritableStreamDefaultController controller, optional any chunk); +callback UnderlyingSinkCloseCallback = Promise (); +callback UnderlyingSinkAbortCallback = Promise (optional any reason); + +[Exposed=(Window,Worker,Worklet)] +interface WritableStreamDefaultWriter { + constructor(WritableStream stream); + + readonly attribute Promise closed; + readonly attribute unrestricted double? desiredSize; + readonly attribute Promise ready; + + Promise abort(optional any reason); + Promise close(); + void releaseLock(); + Promise write(optional any chunk); +}; + +[Exposed=(Window,Worker,Worklet)] +interface WritableStreamDefaultController { + void error(optional any e); +}; + +[Exposed=(Window,Worker,Worklet)] +interface TransformStream { + constructor(optional object transformer, + optional QueuingStrategy writableStrategy = {}, + optional QueuingStrategy readableStrategy = {}); + + readonly attribute ReadableStream readable; + readonly attribute WritableStream writable; +}; + +dictionary Transformer { + TransformerStartCallback start; + TransformerTransformCallback transform; + TransformerFlushCallback flush; + any readableType; + any writableType; +}; + +callback TransformerStartCallback = any (TransformStreamDefaultController controller); +callback TransformerFlushCallback = Promise (TransformStreamDefaultController controller); +callback TransformerTransformCallback = Promise (TransformStreamDefaultController controller, optional any chunk); + +[Exposed=(Window,Worker,Worklet)] +interface TransformStreamDefaultController { + readonly attribute unrestricted double? desiredSize; + + void enqueue(optional any chunk); + void error(optional any reason); + void terminate(); +}; + +dictionary QueuingStrategy { + unrestricted double highWaterMark; + QueuingStrategySize size; +}; + +callback QueuingStrategySize = unrestricted double (optional any chunk); + +dictionary QueuingStrategyInit { + required unrestricted double highWaterMark; +}; + +[Exposed=(Window,Worker,Worklet)] +interface ByteLengthQueuingStrategy { + constructor(QueuingStrategyInit init); + + readonly attribute unrestricted double highWaterMark; + readonly attribute Function size; +}; + +[Exposed=(Window,Worker,Worklet)] +interface CountQueuingStrategy { + constructor(QueuingStrategyInit init); + + readonly attribute unrestricted double highWaterMark; + readonly attribute Function size; +}; diff --git a/tests/wpt/web-platform-tests/media-feeds/META.yml b/tests/wpt/web-platform-tests/media-feeds/META.yml new file mode 100644 index 00000000000..47656c53b02 --- /dev/null +++ b/tests/wpt/web-platform-tests/media-feeds/META.yml @@ -0,0 +1,3 @@ +spec: https://wicg.github.io/media-feeds/ +suggested_reviewers: + - beccahughes diff --git a/tests/wpt/web-platform-tests/media-feeds/link-rel-media-feed.html b/tests/wpt/web-platform-tests/media-feeds/link-rel-media-feed.html new file mode 100644 index 00000000000..e266e5ae8ab --- /dev/null +++ b/tests/wpt/web-platform-tests/media-feeds/link-rel-media-feed.html @@ -0,0 +1,11 @@ + +Test that "media-feed" is a supported value for the `rel` of a `link` + + + + diff --git a/tests/wpt/web-platform-tests/native-file-system/idlharness.https.any.js b/tests/wpt/web-platform-tests/native-file-system/idlharness.https.any.js index 98b27fd9e38..a9090baeee5 100644 --- a/tests/wpt/web-platform-tests/native-file-system/idlharness.https.any.js +++ b/tests/wpt/web-platform-tests/native-file-system/idlharness.https.any.js @@ -6,7 +6,7 @@ idl_test( ['native-file-system'], - ['html', 'dom'], + ['streams', 'html', 'dom'], idl_array => { idl_array.add_objects({ // TODO: Add instances of FileSystemHandle, FileSystemFileHandle, diff --git a/tests/wpt/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers.html b/tests/wpt/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers.html index e860cd082be..066f3a7ea89 100644 --- a/tests/wpt/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers.html +++ b/tests/wpt/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers.html @@ -25,6 +25,7 @@ function run() { var test_pointer_event = setup_pointerevent_test("Event sequence at implicit release on click", ["mouse"]); + var actions_promise; var target = document.getElementById("target"); var capture_target = document.getElementById("capture-target"); @@ -50,14 +51,17 @@ var expected_events = "pointerup, lostpointercapture, pointerout, pointerleave"; assert_equals(event_log.join(", "), "pointerout@target, pointerleave@target, pointerover@capture-target, pointerenter@capture-target, gotpointercapture@capture-target, pointerup@capture-target, lostpointercapture@capture-target, pointerout@capture-target, pointerleave@capture-target, pointerover@target, pointerenter@target"); }); - test_pointer_event.done(); + // Make sure the test finishes after all the input actions are completed. + actions_promise.then( () => { + test_pointer_event.done(); + }); }, 200); } }); }); // Inject mouse inputs. - new test_driver.Actions() + actions_promise = new test_driver.Actions() .pointerMove(0, 0, {origin: target}) .pointerDown() .pointerUp() diff --git a/tests/wpt/web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointerup_mouse.html b/tests/wpt/web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointerup_mouse.html index f37c7cfd144..e86e5ab7ca2 100644 --- a/tests/wpt/web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointerup_mouse.html +++ b/tests/wpt/web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointerup_mouse.html @@ -29,6 +29,7 @@ var pointerupGot = false; var count=0; var event_log = []; + var actions_promise; var detected_pointertypes = {}; add_completion_callback(end_of_test); @@ -68,7 +69,10 @@ }, "pointerup was received before lostpointercapture"); event_log.push('lostpointercapture@target0'); isPointerCapture = false; - done(); + // Make sure the test finishes after all the input actions are completed. + actions_promise.then( () => { + done(); + }); }); on_event(target0, 'pointerup', function(e) { @@ -77,7 +81,7 @@ }); // Inject mouse inputs. - new test_driver.Actions() + actions_promise = new test_driver.Actions() .pointerMove(0, 0, {origin: captureButton}) .pointerDown() .pointerMove(10, 0, {origin: target0}) diff --git a/tests/wpt/web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_in_pointerlock.html b/tests/wpt/web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_in_pointerlock.html index 3cf59d8bf05..f4155180b85 100644 --- a/tests/wpt/web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_in_pointerlock.html +++ b/tests/wpt/web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_in_pointerlock.html @@ -2,13 +2,14 @@ pointermove + - - - - - + + + + + @@ -23,10 +24,11 @@
- + diff --git a/tests/wpt/web-platform-tests/webauthn/createcredential-getpublickey.https.html b/tests/wpt/web-platform-tests/webauthn/createcredential-getpublickey.https.html new file mode 100644 index 00000000000..215519913db --- /dev/null +++ b/tests/wpt/web-platform-tests/webauthn/createcredential-getpublickey.https.html @@ -0,0 +1,52 @@ + + + + +WebAuthn getPublicKey + + + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/webauthn/resources/utils.js b/tests/wpt/web-platform-tests/webauthn/resources/utils.js index f361a94d2e4..50c39605a1b 100644 --- a/tests/wpt/web-platform-tests/webauthn/resources/utils.js +++ b/tests/wpt/web-platform-tests/webauthn/resources/utils.js @@ -17,6 +17,17 @@ function uint8ArrayToBase64url(array) { return base64urlEncode(String.fromCharCode.apply(null, array)); } +// Encodes a Uint8Array to lowercase hex. +function uint8ArrayToHex(array) { + const hexTable = '0123456789abcdef'; + let s = ''; + for (let i = 0; i < array.length; i++) { + s += hexTable.charAt(array[i] >> 4); + s += hexTable.charAt(array[i] & 15); + } + return s; +} + // Convert a EC signature from DER to a concatenation of the r and s parameters, // as expected by the subtle crypto API. function convertDERSignatureToSubtle(der) { @@ -158,13 +169,7 @@ class Cbor { return this.slice.length == 0; } get hex() { - const hexTable = '0123456789abcdef'; - let s = ''; - for (let i = 0; i < this.data.length; i++) { - s += hexTable.charAt(this.data[i] >> 4); - s += hexTable.charAt(this.data[i] & 15); - } - return s; + return uint8ArrayToHex(this.data); } compare(other) { if (this.length < other.length) { diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html index 8f5c21cba40..32638894470 100644 --- a/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html @@ -21,20 +21,23 @@ let testFunction = function(session, fakeDeviceController, t) { let windowFrameTime = 0; let frameTime = 0; let lastFrameTime = 0; + let firstFrame = true; function onFrameFirst(time, xrFrame) { lastFrameTime = frameTime; frameTime = time; - firstFrame = false; let now = performance.now(); t.step( () => { - // This callback must be the first one called. - assert_equals(counter, 0); - - if (!firstFrame) { + if(firstFrame) { + // This callback must be the first one called. + assert_equals(counter, 0); + } else { + // If it's a second animation frame, the timestamp must be greater + // than the timestamp on a previous frame. assert_greater_than(frameTime, lastFrameTime); + // ... but not grater than 10 seconds. assert_approx_equals(frameTime, lastFrameTime, TEN_SECONDS); } @@ -46,11 +49,13 @@ let testFunction = function(session, fakeDeviceController, t) { }); if (firstFrame) { + // We also want this method to run for the second animation frame. session.requestAnimationFrame(onFrameFirst); } else { resolve(); } + firstFrame = false; counter++; } diff --git a/tests/wpt/web-platform-tests/worklets/resources/credentials.py b/tests/wpt/web-platform-tests/worklets/resources/credentials.py index 8709896d1ba..e9fac0e6696 100644 --- a/tests/wpt/web-platform-tests/worklets/resources/credentials.py +++ b/tests/wpt/web-platform-tests/worklets/resources/credentials.py @@ -1,14 +1,14 @@ # Returns a valid response when a request has appropriate credentials. def main(request, response): - cookie = request.cookies.first("cookieName", None) - expected_value = request.GET.first("value", None) - source_origin = request.headers.get("origin", None) + cookie = request.cookies.first(b"cookieName", None) + expected_value = request.GET.first(b"value", None) + source_origin = request.headers.get(b"origin", None) - response_headers = [("Content-Type", "text/javascript"), - ("Access-Control-Allow-Origin", source_origin), - ("Access-Control-Allow-Credentials", "true")] + response_headers = [(b"Content-Type", b"text/javascript"), + (b"Access-Control-Allow-Origin", source_origin), + (b"Access-Control-Allow-Credentials", b"true")] if cookie == expected_value: - return (200, response_headers, "") + return (200, response_headers, u"") return (404, response_headers) diff --git a/tests/wpt/web-platform-tests/worklets/resources/referrer-checker.py b/tests/wpt/web-platform-tests/worklets/resources/referrer-checker.py index 8f379839743..4c6ea6e5c21 100644 --- a/tests/wpt/web-platform-tests/worklets/resources/referrer-checker.py +++ b/tests/wpt/web-platform-tests/worklets/resources/referrer-checker.py @@ -6,19 +6,19 @@ def main(request, response): # thus cannot be compared with the actual referrer header if it were to # contain query params. This works fine if the actual referrer has no # query params too. - referrer = request.headers.get("referer", "").split("?")[0] - referrer_policy = request.GET.first("referrer_policy") - expected_referrer = request.GET.first("expected_referrer", "") - response_headers = [("Content-Type", "text/javascript"), - ("Access-Control-Allow-Origin", "*")] + referrer = request.headers.get(b"referer", b"").split(b"?")[0] + referrer_policy = request.GET.first(b"referrer_policy") + expected_referrer = request.GET.first(b"expected_referrer", b"") + response_headers = [(b"Content-Type", b"text/javascript"), + (b"Access-Control-Allow-Origin", b"*")] - if referrer_policy == "no-referrer" or referrer_policy == "origin": + if referrer_policy == b"no-referrer" or referrer_policy == b"origin": if referrer == expected_referrer: - return (200, response_headers, "") + return (200, response_headers, u"") return (404, response_headers) - if referrer_policy == "same-origin": + if referrer_policy == b"same-origin": if referrer == expected_referrer: - return (200, response_headers, "") + return (200, response_headers, u"") return (404, response_headers) return (404, response_headers) diff --git a/tests/wpt/web-platform-tests/worklets/resources/set-cookie.py b/tests/wpt/web-platform-tests/worklets/resources/set-cookie.py index 6da37be94c4..1b6eb6c1028 100644 --- a/tests/wpt/web-platform-tests/worklets/resources/set-cookie.py +++ b/tests/wpt/web-platform-tests/worklets/resources/set-cookie.py @@ -1,9 +1,9 @@ def main(request, response): - name = request.GET.first("name") - value = request.GET.first("value") - source_origin = request.headers.get("origin", None) + name = request.GET.first(b"name") + value = request.GET.first(b"value") + source_origin = request.headers.get(b"origin", None) - response_headers = [("Set-Cookie", name + "=" + value), - ("Access-Control-Allow-Origin", source_origin), - ("Access-Control-Allow-Credentials", "true")] - return (200, response_headers, "") + response_headers = [(b"Set-Cookie", name + b"=" + value), + (b"Access-Control-Allow-Origin", source_origin), + (b"Access-Control-Allow-Credentials", b"true")] + return (200, response_headers, u"") diff --git a/tests/wpt/web-platform-tests/x-frame-options/support/nested.py b/tests/wpt/web-platform-tests/x-frame-options/support/nested.py index e640f37a230..78c8c18466e 100644 --- a/tests/wpt/web-platform-tests/x-frame-options/support/nested.py +++ b/tests/wpt/web-platform-tests/x-frame-options/support/nested.py @@ -1,10 +1,10 @@ def main(request, response): - origin = request.GET.first("origin"); - value = request.GET.first("value"); + origin = request.GET.first(b"origin"); + value = request.GET.first(b"value"); # This is used to solve the race condition we have for postMessages - shouldSucceed = request.GET.first("loadShouldSucceed", "false"); - return ([("Content-Type", "text/html")], - """ + shouldSucceed = request.GET.first(b"loadShouldSucceed", b"false"); + return ([(b"Content-Type", b"text/html")], + b""" XFO.