browser_dbg-xhr-run-to-completion.js (1672B)
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 // Test that XHR handlers are not called when pausing in the debugger. 6 7 "use strict"; 8 9 add_task(async function () { 10 const dbg = await initDebugger("doc-xhr-run-to-completion.html"); 11 invokeInTab("singleRequest", "doc-xhr-run-to-completion.html"); 12 await waitForPaused(dbg); 13 await waitForSelectedLocation(dbg, 23); 14 await assertPausedAtSourceAndLine( 15 dbg, 16 findSource(dbg, "doc-xhr-run-to-completion.html").id, 17 23 18 ); 19 20 const onTestPassed = once(Services.ppmm, "test passed"); 21 await resume(dbg); 22 await onTestPassed; 23 }); 24 25 // Test that XHR handlers are not called when pausing in the debugger, 26 // including when there are multiple XHRs and multiple times we pause before 27 // they can be processed. 28 add_task(async function () { 29 const dbg = await initDebugger("doc-xhr-run-to-completion.html"); 30 invokeInTab("multipleRequests", "doc-xhr-run-to-completion.html"); 31 await waitForPaused(dbg); 32 await assertPausedAtSourceAndLine( 33 dbg, 34 findSource(dbg, "doc-xhr-run-to-completion.html").id, 35 31 36 ); 37 await resume(dbg); 38 await waitForPaused(dbg); 39 await assertPausedAtSourceAndLine( 40 dbg, 41 findSource(dbg, "doc-xhr-run-to-completion.html").id, 42 33 43 ); 44 await resume(dbg); 45 await waitForPaused(dbg); 46 await assertPausedAtSourceAndLine( 47 dbg, 48 findSource(dbg, "doc-xhr-run-to-completion.html").id, 49 34 50 ); 51 const onTestPassed = once(Services.ppmm, "test passed"); 52 await resume(dbg); 53 await onTestPassed; 54 });