Files
firefox/devtools/client/webide/test/test_import.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

83 lines
3.2 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() {
const win = await openWebIDE();
const docProject = getProjectDocument(win);
const winProject = getProjectWindow(win);
const packagedAppLocation = getTestFilePath("app");
await win.AppProjects.load();
is(win.AppProjects.projects.length, 0, "IDB is empty");
info("to call importPackagedApp(" + packagedAppLocation + ")");
ok(!win.UI._busyPromise, "UI is not busy");
const onValidated = waitForUpdate(win, "project-validated");
const onDetails = waitForUpdate(win, "details");
await winProject.projectList.importPackagedApp(packagedAppLocation);
await onValidated;
await onDetails;
let project = win.AppManager.selectedProject;
is(project.location, packagedAppLocation, "Location is valid");
is(project.name, "A name (in app directory)", "name field has been updated");
is(project.manifest.launch_path, "/index.html", "manifest found. launch_path valid.");
is(project.manifest.description, "desc", "manifest found. description valid");
await nextTick();
let hostedAppManifest = TEST_BASE + "hosted_app.manifest";
await winProject.projectList.importHostedApp(hostedAppManifest);
await waitForUpdate(win, "project-validated");
project = win.AppManager.selectedProject;
is(project.location, hostedAppManifest, "Location is valid");
is(project.name, "hosted manifest name property", "name field has been updated");
await nextTick();
hostedAppManifest = TEST_BASE + "/app";
await winProject.projectList.importHostedApp(hostedAppManifest);
await waitForUpdate(win, "project-validated");
project = win.AppManager.selectedProject;
ok(project.location.endsWith("manifest.webapp"), "The manifest was found and the project was updated");
const panelNode = docProject.querySelector("#project-panel");
const items = panelNode.querySelectorAll(".panel-item");
// 4 controls, + 2 projects
is(items.length, 6, "6 projects in panel");
is(items[3].querySelector("span").textContent, "A name (in app directory)", "Panel text is correct");
is(items[4].querySelector("span").textContent, "hosted manifest name property", "Panel text is correct");
await closeWebIDE(win);
await removeAllProjects();
SimpleTest.finish();
})().catch(e => {
ok(false, "Exception: " + e);
SimpleTest.finish();
});
};
</script>
</body>
</html>