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/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_runtime_page_runtime_info.js | |
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/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_runtime_page_runtime_info.js')
-rw-r--r-- | devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_runtime_page_runtime_info.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_runtime_page_runtime_info.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_runtime_page_runtime_info.js new file mode 100644 index 0000000000..16462fd2b3 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_runtime_page_runtime_info.js @@ -0,0 +1,62 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-real-usb.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-real-usb.js", + this +); + +// Test that runtime info of USB runtime appears on main pane. +// Documentation for real usb tests in /documentation/TESTS_REAL_DEVICES.md +add_task(async function () { + if (!isAvailable()) { + ok(true, "Real usb runtime test is not available"); + return; + } + + const { document, tab } = await openAboutDebuggingWithADB(); + + const expectedRuntime = await getExpectedRuntime(); + const { runtimeDetails, sidebarInfo } = expectedRuntime; + + info("Connect a USB runtime"); + await Promise.race([ + connectToRuntime(sidebarInfo.deviceName, document), + /* eslint-disable mozilla/no-arbitrary-setTimeout */ + new Promise(resolve => + setTimeout(() => { + ok( + false, + "Failed to connect, did you disable the connection prompt for this runtime?" + ); + resolve(); + }, 5000) + ), + /* eslint-enable mozilla/no-arbitrary-setTimeout */ + ]); + + info("Select a USB runtime"); + await selectRuntime( + sidebarInfo.deviceName, + runtimeDetails.info.name, + document + ); + + info("Check that runtime info is properly displayed"); + const runtimeInfo = document.querySelector(".qa-runtime-name"); + ok(runtimeInfo, "Runtime info is displayed"); + const runtimeInfoText = runtimeInfo.textContent; + ok( + runtimeInfoText.includes(runtimeDetails.info.name), + "Runtime info shows the correct runtime name: " + runtimeInfoText + ); + ok( + runtimeInfoText.includes(runtimeDetails.info.version), + "Runtime info shows the correct version number: " + runtimeInfoText + ); + + await removeTab(tab); +}); |