browser_aboutdebugging_real_usb_sidebar.js (1090B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 /* import-globals-from helper-real-usb.js */ 7 Services.scriptloader.loadSubScript( 8 CHROME_URL_ROOT + "helper-real-usb.js", 9 this 10 ); 11 12 // Test that USB runtimes appear from the sidebar. 13 // Documentation for real usb tests in /documentation/TESTS_REAL_DEVICES.md 14 add_task(async function () { 15 if (!isAvailable()) { 16 ok(true, "Real usb runtime test is not available"); 17 return; 18 } 19 20 const { document, tab } = await openAboutDebuggingWithADB(); 21 22 for (const { sidebarInfo } of await getExpectedRuntimeAll()) { 23 const { deviceName, shortName } = sidebarInfo; 24 await waitUntil(() => findSidebarItemByText(deviceName, document)); 25 const usbRuntimeSidebarItem = findSidebarItemByText(deviceName, document); 26 ok( 27 usbRuntimeSidebarItem.textContent.includes(shortName), 28 "The device name and short name of the usb runtime are visible in sidebar item " + 29 `[${usbRuntimeSidebarItem.textContent}]` 30 ); 31 } 32 33 await removeTab(tab); 34 });