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
98 lines
2.9 KiB
HTML
98 lines
2.9 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();
|
|
|
|
(async function() {
|
|
DebuggerServer.init();
|
|
DebuggerServer.registerAllActors();
|
|
|
|
let win = await openWebIDE();
|
|
const docRuntime = getRuntimeDocument(win);
|
|
|
|
const fakeRuntime = {
|
|
type: "USB",
|
|
connect: function(connection) {
|
|
is(connection, win.AppManager.connection, "connection is valid");
|
|
connection.host = null; // force connectPipe
|
|
connection.connect();
|
|
return Promise.resolve();
|
|
},
|
|
|
|
get id() {
|
|
return "fakeRuntime";
|
|
},
|
|
|
|
get name() {
|
|
return "fakeRuntime";
|
|
},
|
|
};
|
|
win.AppManager.runtimeList.usb.push(fakeRuntime);
|
|
win.AppManager.update("runtime-list");
|
|
|
|
const panelNode = docRuntime.querySelector("#runtime-panel");
|
|
const items = panelNode.querySelectorAll(".runtime-panel-item-usb");
|
|
is(items.length, 1, "Found one runtime button");
|
|
|
|
let connectionsChanged = waitForConnectionChange("opened");
|
|
items[0].click();
|
|
|
|
ok(win.document.querySelector("window").classList.contains("busy"),
|
|
"UI is busy");
|
|
await win.UI._busyPromise;
|
|
|
|
await connectionsChanged;
|
|
is(Object.keys(DebuggerServer._connections).length, 1, "Connected");
|
|
|
|
connectionsChanged = waitForConnectionChange("closed");
|
|
|
|
await nextTick();
|
|
await closeWebIDE(win);
|
|
|
|
await connectionsChanged;
|
|
is(Object.keys(DebuggerServer._connections).length, 0, "Disconnected");
|
|
|
|
// The DebuggerServer is destroyed when closing WebIDE, so re-initialize it.
|
|
DebuggerServer.init();
|
|
DebuggerServer.registerAllActors();
|
|
|
|
connectionsChanged = waitForConnectionChange("opened");
|
|
|
|
win = await openWebIDE();
|
|
|
|
win.AppManager.runtimeList.usb.push(fakeRuntime);
|
|
win.AppManager.update("runtime-list");
|
|
|
|
await waitForUpdate(win, "runtime-targets");
|
|
|
|
await connectionsChanged;
|
|
is(Object.keys(DebuggerServer._connections).length, 1, "Automatically reconnected");
|
|
|
|
await win.Cmds.disconnectRuntime();
|
|
|
|
await closeWebIDE(win);
|
|
|
|
DebuggerServer.destroy();
|
|
|
|
SimpleTest.finish();
|
|
})();
|
|
};
|
|
</script>
|
|
</body>
|
|
</html>
|