mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-25 02:40:22 -10:00
This is an autogenerated commit to handle scripts loading mochitest harness files, in the simple case where the script src is on the same line as the tag. This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170 using the `--part 1` argument. Differential Revision: https://phabricator.services.mozilla.com/D26812
86 lines
2.8 KiB
HTML
86 lines
2.8 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf8">
|
|
<title></title>
|
|
|
|
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
|
<script 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 { adbAddon, ADB_ADDON_STATES } = require("devtools/shared/adb/adb-addon");
|
|
function isAdbAddonInstalled() {
|
|
return adbAddon.status === ADB_ADDON_STATES.INSTALLED;
|
|
}
|
|
|
|
function uninstallADBFromUI(doc) {
|
|
return new Promise((resolve, reject) => {
|
|
adbAddon.on("update", function onUpdate() {
|
|
nextTick().then(() => {
|
|
const li = doc.querySelector('[status="uninstalled"][addon="adb"]');
|
|
if (li) {
|
|
adbAddon.off("update", onUpdate);
|
|
resolve();
|
|
} else {
|
|
reject("Can't find item");
|
|
}
|
|
});
|
|
});
|
|
const li = doc.querySelector('[status="installed"][addon="adb"]');
|
|
li.querySelector(".uninstall-button").click();
|
|
});
|
|
}
|
|
|
|
(async function() {
|
|
ok(!isAdbAddonInstalled(), "ADB extension not installed");
|
|
|
|
const win = await openWebIDE({
|
|
autoInstallAddons: true,
|
|
});
|
|
|
|
// ADB is installed asynchronously after starting WebIDE.
|
|
while (!isAdbAddonInstalled()) {
|
|
await adbAddon.once("update");
|
|
}
|
|
|
|
ok(isAdbAddonInstalled(), "ADB extension has been auto-installed");
|
|
|
|
await nextTick();
|
|
|
|
const addonDoc = getAddonsDocument(win);
|
|
const w = addonDoc.querySelector(".warning");
|
|
let display = addonDoc.defaultView.getComputedStyle(w).display;
|
|
is(display, "none", "Warning about missing ADB hidden");
|
|
|
|
await uninstallADBFromUI(addonDoc, "adb");
|
|
|
|
const docRuntime = getRuntimeDocument(win);
|
|
const panelNode = docRuntime.querySelector("#runtime-panel");
|
|
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>
|