browser_bytecode_json_module.js (883B)
1 "use strict"; 2 3 const PAGE_URL = 4 "https://example.com/browser/dom/tests/browser/page_bytecode_cache_json_module.html"; 5 6 async function waitForIdle() { 7 for (let i = 0; i < 10; i++) { 8 await new Promise(resolve => Services.tm.idleDispatchToMainThread(resolve)); 9 } 10 } 11 12 add_task(async function () { 13 // Eagerly generate bytecode cache. 14 await SpecialPowers.pushPrefEnv({ 15 set: [ 16 ["dom.script_loader.bytecode_cache.enabled", true], 17 ["dom.script_loader.bytecode_cache.strategy", -1], 18 ], 19 }); 20 21 await BrowserTestUtils.withNewTab( 22 { 23 gBrowser, 24 url: PAGE_URL, 25 waitForLoad: true, 26 }, 27 async () => { 28 // TODO: Once the bytecode-encoding events are refactored, 29 // listen to the events (bug 1902951). 30 await waitForIdle(); 31 ok(true, "No crash should happen"); 32 } 33 ); 34 35 await SpecialPowers.popPrefEnv(); 36 });