summaryrefslogtreecommitdiffstats
path: root/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_duplicate_after_target_switching.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_duplicate_after_target_switching.js')
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_duplicate_after_target_switching.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_duplicate_after_target_switching.js b/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_duplicate_after_target_switching.js
new file mode 100644
index 0000000000..9848baf3a5
--- /dev/null
+++ b/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_duplicate_after_target_switching.js
@@ -0,0 +1,46 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TEST_URI_ORG = `https://example.org/document-builder.sjs?html=<meta charset=utf8></meta>
+<script>
+ console.log("early message on org page");
+</script><body>`;
+const TEST_URI_COM = TEST_URI_ORG.replace(/org/g, "com");
+
+add_task(async function () {
+ info("Add a tab and open the console");
+ const tab = await addTab("about:robots");
+ const hud = await openConsole(tab);
+
+ {
+ await navigateTo(TEST_URI_ORG);
+
+ // Wait for some time in order to let a chance to have duplicated message
+ // and catch such regression
+ await wait(1000);
+
+ info("wait until the ORG message is displayed");
+ await checkUniqueMessageExists(
+ hud,
+ "early message on org page",
+ ".console-api"
+ );
+ }
+
+ {
+ await navigateTo(TEST_URI_COM);
+
+ // Wait for some time in order to let a chance to have duplicated message
+ // and catch such regression
+ await wait(1000);
+
+ info("wait until the COM message is displayed");
+ await checkUniqueMessageExists(
+ hud,
+ "early message on com page",
+ ".console-api"
+ );
+ }
+});