Bug 1494549 - Wait until ADB started in USB status sidebar test;r=daisuke
☠☠ backed out by 3895062d9e1d ☠ ☠
authorJulian Descottes <jdescottes@mozilla.com>
Wed, 17 Oct 2018 07:21:11 +0000
changeset 500104 5729da1055e8a464e9d062a71084e3983033721a
parent 500103 7c62247314d7faf9ae14362f920e12e62fef8610
child 500105 ea8eead18821aa93cdf822056e4643c7e5e58c2f
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaisuke
bugs1494549
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1494549 - Wait until ADB started in USB status sidebar test;r=daisuke Depends on D8335 Differential Revision: https://phabricator.services.mozilla.com/D8513
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_status.js
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_status.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_status.js
@@ -1,14 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const { adbAddon } = require("devtools/shared/adb/adb-addon");
+const { ADB } = require("devtools/shared/adb/adb");
 
 /**
  * This test asserts that the sidebar shows a message describing the status of the USB
  * devices scanning.
  */
 add_task(async function() {
   // Make sure the ADB addon is removed and ADB is stopped when the test ends.
   registerCleanupFunction(async function() {
@@ -30,14 +31,21 @@ add_task(async function() {
   ok(usbStatusElement, "Sidebar shows the USB status element");
   ok(usbStatusElement.textContent.includes("USB devices disabled"),
     "USB status element has the expected content");
 
   info("Install the adb extension and wait for the message to udpate");
   adbAddon.install();
   await waitUntil(() => usbStatusElement.textContent.includes("USB devices enabled"));
 
+  // Right now we are resuming as soon as "USB devices enabled" is displayed, but ADB
+  // might still be starting up. If we move to uninstall directly, the ADB startup will
+  // fail and we will have an unhandled promise rejection.
+  // See Bug 1498469.
+  info("Wait until ADB has started.");
+  await waitUntil(() => ADB.ready);
+
   info("Uninstall the adb extension and wait for the message to udpate");
   adbAddon.uninstall();
   await waitUntil(() => usbStatusElement.textContent.includes("USB devices disabled"));
 
   await removeTab(tab);
 });