diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /devtools/client/webconsole/test/browser/test-console-logs-exceptions-order.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/webconsole/test/browser/test-console-logs-exceptions-order.html')
-rw-r--r-- | devtools/client/webconsole/test/browser/test-console-logs-exceptions-order.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/devtools/client/webconsole/test/browser/test-console-logs-exceptions-order.html b/devtools/client/webconsole/test/browser/test-console-logs-exceptions-order.html new file mode 100644 index 0000000000..e51df0b38d --- /dev/null +++ b/devtools/client/webconsole/test/browser/test-console-logs-exceptions-order.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Webconsole order test test page</title> + </head> + <body> + <button>dispatched event target</button> + <script> + "use strict"; + const btn = document.querySelector("button"); + btn.addEventListener("click", () => { + console.log("First"); + // Don't throw an error as its stacktrace (whose rendering is delayed) + // might show up in the console message body and mess with the test. + // eslint-disable-next-line no-throw-literal + throw "Second"; + }); + + // Use dispatchEvent as the event listener callback will be called directly, + // before the next lines are executed, which gives us a higher chance of + // having all the messages being emitted within the same millisecond. + btn.dispatchEvent(new MouseEvent("click")); + + console.log("Third"); + // Don't throw an error as its stacktrace (whose rendering is delayed) + // might show up in the console message body and mess with the test. + // eslint-disable-next-line no-throw-literal + throw "Fourth"; + </script> + </body> +</html> |