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
  • Loading branch information
evliu-google authored and chromium-wpt-export-bot committed Mar 5, 2025
1 parent a9f4eee commit 1bd605b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions speech-api/SpeechRecognition-availableOnDevice.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@
"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 === "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 1bd605b

Please sign in to comment.