summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/compatibility/test/browser/browser_compatibility_throbber.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /devtools/client/inspector/compatibility/test/browser/browser_compatibility_throbber.js
parentInitial commit. (diff)
downloadfirefox-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 '')
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_throbber.js69
1 files changed, 69 insertions, 0 deletions
diff --git a/devtools/client/inspector/compatibility/test/browser/browser_compatibility_throbber.js b/devtools/client/inspector/compatibility/test/browser/browser_compatibility_throbber.js
new file mode 100644
index 0000000000..eff0f9ac93
--- /dev/null
+++ b/devtools/client/inspector/compatibility/test/browser/browser_compatibility_throbber.js
@@ -0,0 +1,69 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test whether the throbber is displayed correctly or not.
+
+const TEST_URI = `
+ <style>
+ body {
+ color: blue;
+ border-block-color: lime;
+ user-modify: read-only;
+ }
+ div {
+ font-variant-alternates: historical-forms;
+ }
+ </style>
+ <body>
+ <div>test</div>
+ </body>
+`;
+
+const {
+ COMPATIBILITY_UPDATE_TOP_LEVEL_TARGET_START,
+} = require("resource://devtools/client/inspector/compatibility/actions/index.js");
+
+add_task(async function () {
+ const tab = await addTab(
+ "data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI)
+ );
+
+ const { allElementsPane, inspector, selectedElementPane } =
+ await openCompatibilityView();
+
+ info("Check the throbber visibility at the beginning");
+ assertThrobber(allElementsPane, false);
+ assertThrobber(selectedElementPane, false);
+
+ info("Reload the browsing page");
+ const onStart = waitForDispatch(
+ inspector.store,
+ COMPATIBILITY_UPDATE_TOP_LEVEL_TARGET_START
+ );
+ const onComplete = waitForDispatch(
+ inspector.store,
+ COMPATIBILITY_UPDATE_TOP_LEVEL_TARGET_COMPLETE
+ );
+ gBrowser.reloadTab(tab);
+
+ info("Check the throbber visibility of after starting updating action");
+ await onStart;
+ assertThrobber(allElementsPane, true);
+ assertThrobber(selectedElementPane, false);
+
+ info("Check the throbber visibility of after completing updating action");
+ await onComplete;
+ assertThrobber(allElementsPane, false);
+ assertThrobber(selectedElementPane, false);
+});
+
+function assertThrobber(panel, expectedVisibility) {
+ const isThrobberVisible = !!panel.querySelector(".devtools-throbber");
+ is(
+ isThrobberVisible,
+ expectedVisibility,
+ "Visibility of the throbber is correct"
+ );
+}