Skip to content

Commit 34b03e2

Browse files
Nathan Memmottmoz-wptsync-bot
Nathan Memmott
authored andcommitted
Bug 1945590 [wpt PR 50451] - Translator: Align more with explainer, a=testonly
Automatic update from web-platform-tests Translator: Align more with explainer Updates the idl to closer match the explainer: - Separates AITranslatorCreateOptions and AITranslatorCreateCoreOptions - Adds the unimplemented monitor option - Makes the options not optional Fixed: 393453435 Change-Id: I1eb2ee5c52c51003b5ee670f0e7d97f844b3f038 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6219712 Commit-Queue: Nathan Memmott <[email protected]> Reviewed-by: Jiacheng Guo <[email protected]> Cr-Commit-Position: refs/heads/main@{#1415025} -- wpt-commits: 500d15f336d08218f1513159c4240cd6b01fb7bf wpt-pr: 50451
1 parent d799bf3 commit 34b03e2

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

testing/web-platform/tests/ai/translator/ai_translator_bad_input.tentative.https.any.js

+13-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@
88
'use strict';
99

1010
promise_test(async t => {
11-
const translatorFactory = ai.translator;
12-
assert_not_equals(translatorFactory, null);
13-
await promise_rejects_dom(t, 'InvalidStateError',translatorFactory.create(/*empty options*/),
14-
'No options are provided.');
15-
});
11+
await promise_rejects_js(
12+
t, TypeError, ai.translator.create(/*empty options*/));
13+
}, 'AITranslatorFactory.create rejects with TypeError if no options are passed.');
14+
15+
promise_test(async t => {
16+
await promise_rejects_js(
17+
t, TypeError, ai.translator.create({sourceLanguage: 'en'}));
18+
}, 'AITranslatorFactory.create rejects with TypeError targetLanguage is not provided.');
19+
20+
promise_test(async t => {
21+
await promise_rejects_js(
22+
t, TypeError, ai.translator.create({targetLanguage: 'en'}));
23+
}, 'AITranslatorFactory.create rejects with TypeError sourceLanguage is not provided.');

0 commit comments

Comments
 (0)