browser_dbg-message-run-to-completion.js (972B)
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 messages from postMessage calls are not delivered while paused in 6 // the debugger. 7 8 "use strict"; 9 10 add_task(async function () { 11 const dbg = await initDebugger("doc-message-run-to-completion.html"); 12 invokeInTab("test", "doc-message-run-to-completion.html"); 13 await waitForPaused(dbg); 14 let result = await dbg.client.evaluate("event.data"); 15 is(result.result, "first", "first message delivered in order"); 16 await resume(dbg); 17 await waitForPaused(dbg); 18 result = await dbg.client.evaluate("event.data"); 19 is(result.result, "second", "second message delivered in order"); 20 await resume(dbg); 21 await waitForPaused(dbg); 22 result = await dbg.client.evaluate("event.data"); 23 is(result.result, "third", "third message delivered in order"); 24 });