script: Enable crypto task source at task manager (#39453)

The Web Cryptography API has the "crypto task source"
(https://w3c.github.io/webcrypto/#dfn-crypto-task-source-0) to queue
tasks to resolve or reject promises created in response to calls to
methods of `SubtleCrypto`.

This patch enables this task source at the script task manager, and
queue tasks on this task source from existing steps.

A few WPT error expectations are also added to WPT meta. The related
cryptographic algorithms have not yet implemented, so the errors are
expected. I don't know why WPT test did not capture them before.

Testing: Existing tests suffice.

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
This commit is contained in:
Kingsley Yung 2025-09-25 00:21:03 +08:00 committed by GitHub
parent da221d4045
commit 9d7b438d6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 48 additions and 17 deletions

View file

@ -26,6 +26,8 @@ pub(crate) enum TaskSourceName {
Bitmap,
Canvas,
Clipboard,
/// <https://w3c.github.io/webcrypto/#dfn-crypto-task-source-0>
Crypto,
DatabaseAccess,
DOMManipulation,
FileReading,
@ -56,6 +58,7 @@ impl From<TaskSourceName> for ScriptThreadEventCategory {
TaskSourceName::Bitmap => ScriptThreadEventCategory::ScriptEvent,
TaskSourceName::Canvas => ScriptThreadEventCategory::ScriptEvent,
TaskSourceName::Clipboard => ScriptThreadEventCategory::ScriptEvent,
TaskSourceName::Crypto => ScriptThreadEventCategory::ScriptEvent,
TaskSourceName::DatabaseAccess => ScriptThreadEventCategory::ScriptEvent,
TaskSourceName::DOMManipulation => ScriptThreadEventCategory::ScriptEvent,
TaskSourceName::FileReading => ScriptThreadEventCategory::FileRead,