mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-28 13:40:17 -10:00
75 lines
2.3 KiB
HTML
75 lines
2.3 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">
|
|
window.onload = function() {
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
const {Devices} = Cu.import("resource://devtools/shared/apps/Devices.jsm");
|
|
|
|
let adbAddonsInstalled;
|
|
|
|
function uninstallADBFromUI(doc) {
|
|
return new Promise((resolve, reject) => {
|
|
Devices.on("addon-status-updated", function onUpdate() {
|
|
nextTick().then(() => {
|
|
let li = doc.querySelector('[status="uninstalled"][addon="adb"]');
|
|
if (li) {
|
|
Devices.off("addon-status-updated", onUpdate);
|
|
resolve();
|
|
} else {
|
|
reject("Can't find item");
|
|
}
|
|
})
|
|
});
|
|
let li = doc.querySelector('[status="installed"][addon="adb"]');
|
|
li.querySelector(".uninstall-button").click();
|
|
});
|
|
}
|
|
|
|
Task.spawn(function*() {
|
|
|
|
ok(!Devices.helperAddonInstalled, "Helper not installed");
|
|
|
|
let win = yield openWebIDE(true);
|
|
let docRuntime = getRuntimeDocument(win);
|
|
|
|
ok(Devices.helperAddonInstalled, "Helper has been auto-installed");
|
|
|
|
yield nextTick();
|
|
|
|
let w = addonDoc.querySelector(".warning");
|
|
let display = addonDoc.defaultView.getComputedStyle(w).display
|
|
is(display, "none", "Warning about missing ADB hidden");
|
|
|
|
yield 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");
|
|
|
|
yield closeWebIDE(win);
|
|
|
|
SimpleTest.finish();
|
|
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|