diff options
Diffstat (limited to 'devtools/client/debugger/test/mochitest/browser_dbg-message-run-to-completion.js')
-rw-r--r-- | devtools/client/debugger/test/mochitest/browser_dbg-message-run-to-completion.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-message-run-to-completion.js b/devtools/client/debugger/test/mochitest/browser_dbg-message-run-to-completion.js new file mode 100644 index 0000000000..a168c9233d --- /dev/null +++ b/devtools/client/debugger/test/mochitest/browser_dbg-message-run-to-completion.js @@ -0,0 +1,24 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ + +// Test that messages from postMessage calls are not delivered while paused in +// the debugger. + +"use strict"; + +add_task(async function () { + const dbg = await initDebugger("doc-message-run-to-completion.html"); + invokeInTab("test", "doc-message-run-to-completion.html"); + await waitForPaused(dbg); + let result = await dbg.client.evaluate("event.data"); + is(result.result, "first", "first message delivered in order"); + await resume(dbg); + await waitForPaused(dbg); + result = await dbg.client.evaluate("event.data"); + is(result.result, "second", "second message delivered in order"); + await resume(dbg); + await waitForPaused(dbg); + result = await dbg.client.evaluate("event.data"); + is(result.result, "third", "third message delivered in order"); +}); |