summaryrefslogtreecommitdiffstats
path: root/devtools/client/webide/test/test_newapp.html
blob: 45374f26810d09e1700d2a133d05dcd0a6cdbd55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!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();

        Task.spawn(function* () {
          let win = yield openWebIDE();
          let winProject = getProjectWindow(win);
          let tmpDir = FileUtils.getDir("TmpD", []);
          yield winProject.projectList.newApp({
            index: 0,
            name: "webideTmpApp",
            folder: tmpDir
          });

          let project = win.AppManager.selectedProject;
          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);
          yield closeWebIDE(win);
          yield removeAllProjects();
          SimpleTest.finish();
        });
      }
    </script>
  </body>
</html>