Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /ai/language-model/language-model-prompt-gc.tentative.https.window.html - WPT Dashboard Interop Dashboard
// META: title=Language Model Prompt GC
// META: script=/resources/testdriver.js
// META: script=../resources/util.js
// META: timeout=long
'use strict';
promise_test(async () => {
await ensureLanguageModel();
// Start a new session.
const session = await createLanguageModel();
// Test the prompt API.
const promptPromise = session.prompt(kTestPrompt);
// Run GC.
gc();
const result = await promptPromise;
assert_equals(typeof result, "string");
}, 'Prompt API must continue even after GC has been performed.');