summaryrefslogtreecommitdiffstats
path: root/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_remote_runtime_buttons.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_remote_runtime_buttons.js')
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_remote_runtime_buttons.js56
1 files changed, 56 insertions, 0 deletions
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_remote_runtime_buttons.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_remote_runtime_buttons.js
new file mode 100644
index 0000000000..563fe659ce
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_remote_runtime_buttons.js
@@ -0,0 +1,56 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const USB_RUNTIME_ID = "1337id";
+const USB_DEVICE_NAME = "Fancy Phone";
+const USB_APP_NAME = "Lorem ipsum";
+
+/**
+ * Test that remote runtimes show action buttons that are hidden for 'This Firefox'.
+ */
+add_task(async function () {
+ // enable USB devices mocks
+ const mocks = new Mocks();
+ mocks.createUSBRuntime(USB_RUNTIME_ID, {
+ deviceName: USB_DEVICE_NAME,
+ name: USB_APP_NAME,
+ });
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Checking This Firefox");
+ ok(
+ !document.querySelector(".qa-connection-prompt-toggle-button"),
+ "This Firefox does not contain the connection prompt button"
+ );
+ ok(
+ !document.querySelector(".qa-profile-runtime-button"),
+ "This Firefox does not contain the profile runtime button"
+ );
+ ok(
+ !document.querySelector(".qa-runtime-info__action"),
+ "This Firefox does not contain the disconnect button"
+ );
+
+ info("Checking a USB runtime");
+ mocks.emitUSBUpdate();
+ await connectToRuntime(USB_DEVICE_NAME, document);
+ await selectRuntime(USB_DEVICE_NAME, USB_APP_NAME, document);
+ ok(
+ !!document.querySelector(".qa-connection-prompt-toggle-button"),
+ "Runtime contains the connection prompt button"
+ );
+ ok(
+ !!document.querySelector(".qa-profile-runtime-button"),
+ "Remote runtime contains the profile runtime button"
+ );
+ ok(
+ !!document.querySelector(".qa-runtime-info__action"),
+ "Runtime contains the disconnect button"
+ );
+
+ await removeTab(tab);
+});