language-model-prompt-context-destroyed.tentative.https.window.js (658B)
1 // META: title=Language Model Prompt Context Destroyed 2 // META: script=/resources/testdriver.js 3 // META: script=../resources/util.js 4 // META: timeout=long 5 6 'use strict'; 7 8 promise_test(async t => { 9 assert_true(!!LanguageModel); 10 // Create the iframe and append it to the document. 11 const iframe = document.createElement('iframe'); 12 document.childNodes[document.childNodes.length - 1].appendChild(iframe); 13 14 await test_driver.bless(); 15 const session = await iframe.contentWindow.LanguageModel.create(); 16 session.prompt(kTestPrompt); 17 // Detach the iframe. 18 iframe.remove(); 19 }, 'Detaching iframe while running prompt() should not cause memory leak');