mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-28 04:39:07 -10:00
73 lines
2.4 KiB
HTML
73 lines
2.4 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf8">
|
|
<title></title>
|
|
|
|
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
|
<script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
|
|
<script type="application/javascript" src="head.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<script type="application/javascript">
|
|
// XXX Bug 1072167 - When updating after migration, fix the no-undef issues.
|
|
/* eslint-disable no-undef */
|
|
|
|
window.onload = function() {
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
const {Devices} = ChromeUtils.import("resource://devtools/shared/apps/Devices.jsm", {});
|
|
|
|
function uninstallADBFromUI(doc) {
|
|
return new Promise((resolve, reject) => {
|
|
Devices.on("addon-status-updated", function onUpdate() {
|
|
nextTick().then(() => {
|
|
const li = doc.querySelector('[status="uninstalled"][addon="adb"]');
|
|
if (li) {
|
|
Devices.off("addon-status-updated", onUpdate);
|
|
resolve();
|
|
} else {
|
|
reject("Can't find item");
|
|
}
|
|
});
|
|
});
|
|
const li = doc.querySelector('[status="installed"][addon="adb"]');
|
|
li.querySelector(".uninstall-button").click();
|
|
});
|
|
}
|
|
|
|
(async function() {
|
|
ok(!Devices.helperAddonInstalled, "Helper not installed");
|
|
|
|
const win = await openWebIDE(true);
|
|
|
|
ok(Devices.helperAddonInstalled, "Helper has been auto-installed");
|
|
|
|
await nextTick();
|
|
|
|
const w = addonDoc.querySelector(".warning");
|
|
let display = addonDoc.defaultView.getComputedStyle(w).display;
|
|
is(display, "none", "Warning about missing ADB hidden");
|
|
|
|
await uninstallADBFromUI(addonDoc, "adb");
|
|
|
|
items = panelNode.querySelectorAll(".runtime-panel-item-usb");
|
|
is(items.length, 0, "No usb runtime listed");
|
|
|
|
display = addonDoc.defaultView.getComputedStyle(w).display;
|
|
is(display, "block", "Warning about missing ADB present");
|
|
|
|
await closeWebIDE(win);
|
|
|
|
SimpleTest.finish();
|
|
})();
|
|
};
|
|
</script>
|
|
</body>
|
|
</html>
|