Bug 1494549 - Wait until ADB started in USB status sidebar test;r=daisuke

Depends on D8335

Differential Revision: https://phabricator.services.mozilla.com/D8513

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2018-10-17 11:11:53 +00:00
Родитель 795c6e7708
Коммит 2959e3bfe3
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -4,6 +4,7 @@
"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
@ -35,6 +36,13 @@ add_task(async function() {
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"));