summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/test/mochitest/browser_dbg-message-run-to-completion.js
blob: a168c9233da877d9e846688b6ad768e05c2d8aee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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");
});