Files
firefox/devtools/client/webide/test/test_device_runtime.html
T

80 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();
(async function() {
DebuggerServer.init();
DebuggerServer.registerAllActors();
let win = await openWebIDE();
let detailsIframe = win.document.querySelector("#deck-panel-runtimedetails");
await connectToLocalRuntime(win);
let details = win.document.querySelector("#cmd_showRuntimeDetails");
ok(!details.hasAttribute("disabled"), "info cmd enabled");
let deck = win.document.querySelector("#deck");
win.Cmds.showRuntimeDetails();
is(deck.selectedPanel, detailsIframe, "info iframe selected");
await nextTick();
await lazyIframeIsLoaded(detailsIframe);
await detailsIframe.contentWindow.getDescriptionPromise;
// device info and permissions content is checked in other tests
// We just test one value to make sure we get something
let doc = detailsIframe.contentWindow.document;
let trs = doc.querySelectorAll("tr");
let found = false;
for (let tr of trs) {
let [name, val] = tr.querySelectorAll("td");
if (name.textContent == "appid") {
found = true;
is(val.textContent, Services.appinfo.ID, "appid has the right value");
break;
}
}
ok(found, "Found appid line");
doc.querySelector("#close").click();
ok(!deck.selectedPanel, "No panel selected");
DebuggerServer.destroy();
await closeWebIDE(win);
SimpleTest.finish();
})().catch(e => {
ok(false, "Exception: " + e);
SimpleTest.finish();
});
};
</script>
</body>
</html>