gecko/browser/devtools/webide/test/test_newapp.html
Paul Rouget b12aab6c39 Bug 1010387 - [appmgr v2] write tests and make good use of promises & tasks. r=janx r=jryans
---
 browser/devtools/app-manager/app-validator.js    |   2 +-
 browser/devtools/webide/content/newapp.js        |  30 +++-
 browser/devtools/webide/content/webide.js        | 180 +++++++++++++++--------
 browser/devtools/webide/modules/app-manager.js   |  27 +++-
 browser/devtools/webide/moz.build                |   1 +
 browser/devtools/webide/test/app.zip             | Bin 0 -> 480 bytes
 browser/devtools/webide/test/app/index.html      |   6 +
 browser/devtools/webide/test/app/manifest.webapp |   5 +
 browser/devtools/webide/test/chrome.ini          |  13 ++
 browser/devtools/webide/test/head.js             |  81 ++++++++++
 browser/devtools/webide/test/hosted_app.manifest |   3 +
 browser/devtools/webide/test/templates.json      |  14 ++
 browser/devtools/webide/test/test_basic.html     |  39 +++++
 browser/devtools/webide/test/test_import.html    |  65 ++++++++
 browser/devtools/webide/test/test_newapp.html    |  48 ++++++
 browser/devtools/webide/test/test_runtime.html   | 118 +++++++++++++++
 browser/devtools/webide/themes/details.css       |   1 -
 browser/devtools/webide/themes/newapp.css        |   4 -
 18 files changed, 558 insertions(+), 79 deletions(-)
 create mode 100644 browser/devtools/webide/test/app.zip
 create mode 100644 browser/devtools/webide/test/app/index.html
 create mode 100644 browser/devtools/webide/test/app/manifest.webapp
 create mode 100644 browser/devtools/webide/test/chrome.ini
 create mode 100644 browser/devtools/webide/test/head.js
 create mode 100644 browser/devtools/webide/test/hosted_app.manifest
 create mode 100644 browser/devtools/webide/test/templates.json
 create mode 100644 browser/devtools/webide/test/test_basic.html
 create mode 100644 browser/devtools/webide/test/test_import.html
 create mode 100644 browser/devtools/webide/test/test_newapp.html
 create mode 100644 browser/devtools/webide/test/test_runtime.html
2014-05-21 09:29:43 +02:00

49 lines
1.6 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;version=1.8" src="head.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
</head>
<body>
<script type="application/javascript;version=1.8">
window.onload = function() {
SimpleTest.waitForExplicitFinish();
Services.prefs.setCharPref("devtools.webide.templatesURL", TEST_BASE + "templates.json");
Task.spawn(function* () {
let win = yield openWebIDE();
let tmpDir = FileUtils.getDir("TmpD", []);
yield win.Cmds.newApp({
index: 0,
name: "webideTmpApp",
folder: tmpDir
});
let project = win.AppManager.selectedProject;
let tmpDir = FileUtils.getDir("TmpD", ["webidetmpapp"]);
ok(tmpDir.isDirectory(), "Directory created");
is(project.location, tmpDir.path, "Location is valid (and lowercase)");
is(project.name, "webideTmpApp", "name field has been updated");
// Clean up
tmpDir.remove(true);
Services.prefs.clearUserPref("devtools.webide.templatesURL");
yield closeWebIDE(win);
yield removeAllProjects();
SimpleTest.finish();
});
}
</script>
</body>
</html>