browser_generalEvents.js (725B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 /** 8 * Test the AsyncContentLoaded event. 9 */ 10 addUiaTask(``, async function testAsyncContentLoaded(browser) { 11 info("Loading new document"); 12 await setUpWaitForUiaEvent("AsyncContentLoaded", "uiaTestDoc"); 13 const encoded = encodeURIComponent('<body id="uiaTestDoc">test'); 14 browser.loadURI(Services.io.newURI(`data:text/html,${encoded}`), { 15 triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(), 16 }); 17 await waitForUiaEvent(); 18 ok(true, "Got AsyncContentLoaded event"); 19 });