Bug 1941704 - Align Performance and End-to-End Tests for the ML Engine with Production Behavior - r=tarek,urlbar-reviewers,cgopal

Differential Revision: https://phabricator.services.mozilla.com/D234266
This commit is contained in:
Aristide Tossou
2025-01-17 13:13:39 +00:00
parent 2c31a86582
commit 10aaecc9fb
9 changed files with 36 additions and 9 deletions

View File

@@ -322,6 +322,17 @@ async function testSuggestion(
add_task(async function test_MLSuggest() {
const { cleanup, remoteClients } = await setup();
const originalIntentOptions = MLSuggest.INTENT_OPTIONS;
const originalNerOptions = MLSuggest.NER_OPTIONS;
// Stubs to indicate that wasm is being mocked
sinon.stub(MLSuggest, "INTENT_OPTIONS").get(() => {
return { ...originalIntentOptions, modelId: "test-echo" };
});
sinon.stub(MLSuggest, "NER_OPTIONS").get(() => {
return { ...originalNerOptions, modelId: "test-echo" };
});
await MLSuggest.initialize();
await testSuggestion(
"restaurants in seattle, wa",