Skip to content

Commit

Permalink
Update return type of availableOnDevice API
Browse files Browse the repository at this point in the history
This CL updates the return type of the availableOnDevice API to reflect
the spec changes in this PR: github.com/WebAudio/web-speech-api/pull/143

Bug: 40286514
Change-Id: I66e4a18e5cdaf262cecd847eca6b2205618028ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6299973
Reviewed-by: Tom Sepez <[email protected]>
Commit-Queue: Evan Liu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1429100}
  • Loading branch information
evliu-google authored and chromium-wpt-export-bot committed Mar 6, 2025
1 parent c985972 commit 339247c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions speech-api/SpeechRecognition-availableOnDevice.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@
"availableOnDevice should return a Promise."
);

// Verify the resolved value is a boolean.
// Verify the resolved value is a string.
const result = await resultPromise;
assert_true(
typeof result === "boolean",
"The resolved value of the availableOnDevice promise should be a boolean."
typeof result === "string",
"The resolved value of the availableOnDevice promise should be a string."
);
}, "SpeechRecognition.availableOnDevice resolves with a boolean value.");

assert_true(
result === "unavailable" || result === "downloadable" ||
result === "downloading" || result === "available",
"The resolved value of the availableOnDevice promise should be a valid value."
);
}, "SpeechRecognition.availableOnDevice resolves with a string value.");

promise_test(async (t) => {
const iframe = document.createElement("iframe");
Expand Down

0 comments on commit 339247c

Please sign in to comment.