summaryrefslogtreecommitdiffstats
path: root/devtools/client/webconsole/test/browser/test-worker.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/webconsole/test/browser/test-worker.js')
-rw-r--r--devtools/client/webconsole/test/browser/test-worker.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/devtools/client/webconsole/test/browser/test-worker.js b/devtools/client/webconsole/test/browser/test-worker.js
new file mode 100644
index 0000000000..76e7934230
--- /dev/null
+++ b/devtools/client/webconsole/test/browser/test-worker.js
@@ -0,0 +1,13 @@
+"use strict";
+
+self.addEventListener("message", function onMessage(event) {
+ const { type, message } = event.data;
+
+ switch (type) {
+ case "log":
+ console.log(message);
+ break;
+ case "error":
+ throw new Error(message);
+ }
+});