Files
firefox/devtools/client/webide/test/test_toolbox.html
T
Brian Grinstead 36c26fa2b9 Bug 1544322 - Part 1 - Remove the [type] attribute for one-liner <script> tags loading files in chrome://mochikit/content/ r=bzbarsky
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
2019-04-15 20:56:58 +00:00

96 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">
window.onload = function() {
SimpleTest.waitForExplicitFinish();
let win;
SimpleTest.registerCleanupFunction(() => {
(async function() {
if (win) {
await closeWebIDE(win);
}
DebuggerServer.destroy();
await removeAllProjects();
})();
});
(async function() {
DebuggerServer.init();
DebuggerServer.registerAllActors();
win = await openWebIDE();
const docRuntime = getRuntimeDocument(win);
const docProject = getProjectDocument(win);
win.AppManager.update("runtime-list");
const deferred = new Promise(resolve => {
win.AppManager.connection.once(
win.Connection.Events.CONNECTED,
resolve);
});
docRuntime.querySelectorAll(".runtime-panel-item-other")[1].click();
ok(win.document.querySelector("window").classList.contains("busy"),
"UI is busy");
await win.UI._busyPromise;
await deferred;
is(Object.keys(DebuggerServer._connections).length, 1, "Connected");
await waitForUpdate(win, "runtime-global-actors");
ok(win.AppManager.isMainProcessDebuggable(), "Main process available");
// Select main process
SimpleTest.executeSoon(() => {
docProject.querySelectorAll("#project-panel-runtimeapps .panel-item")[0].click();
});
await waitForUpdate(win, "project");
// Toolbox opens automatically for main process / runtime apps
ok(win.UI.toolboxPromise, "Toolbox promise exists");
const toolbox = await win.UI.toolboxPromise;
await toolbox.destroy();
ok(!win.UI.toolboxPromise, "Toolbox promise should be unset once toolbox.destroy()'s promise resolves");
// Reopen the toolbox right after to check races and also
// opening a toolbox more than just once against the same target
await win.Cmds.toggleToolbox();
ok(win.UI.toolboxPromise, "Toolbox promise exists");
await win.UI.destroyToolbox();
ok(!win.UI.toolboxPromise, "Toolbox promise is also nullified the second times");
await win.Cmds.disconnectRuntime();
SimpleTest.finish();
})();
};
</script>
</body>
</html>