summaryrefslogtreecommitdiffstats
path: root/devtools/client/webconsole/test/browser/browser_webconsole_worker_promise_error.js
blob: c895031b26435cc1af5cc6d68f2dd582e31692c5 (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
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

// Tests that an uncaught promise rejection inside a Worker or Worklet
// is reported to the tabs' webconsole.

"use strict";

const TEST_URI =
  "https://example.com/browser/devtools/client/webconsole/" +
  "test/browser/test-worker-promise-error.html";

add_task(async function () {
  const hud = await openNewTabAndConsole(TEST_URI);
  await waitFor(() =>
    findErrorMessage(hud, "uncaught exception: worker-error")
  );

  await waitFor(() =>
    findErrorMessage(hud, "uncaught exception: worklet-error")
  );

  ok(true, "received error messages");
});