summaryrefslogtreecommitdiffstats
path: root/devtools/client/projecteditor/test/helper_edits.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /devtools/client/projecteditor/test/helper_edits.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/projecteditor/test/helper_edits.js')
-rw-r--r--devtools/client/projecteditor/test/helper_edits.js53
1 files changed, 53 insertions, 0 deletions
diff --git a/devtools/client/projecteditor/test/helper_edits.js b/devtools/client/projecteditor/test/helper_edits.js
new file mode 100644
index 000000000..d8e83672b
--- /dev/null
+++ b/devtools/client/projecteditor/test/helper_edits.js
@@ -0,0 +1,53 @@
+/* vim: set ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+var helperEditData = [
+ {
+ basename: "styles.css",
+ path: "css/styles.css",
+ newContent: "body,html { color: orange; }"
+ },
+ {
+ basename: "index.html",
+ path: "index.html",
+ newContent: "<h1>Changed Content Again</h1>"
+ },
+ {
+ basename: "LICENSE",
+ path: "LICENSE",
+ newContent: "My new license"
+ },
+ {
+ basename: "README.md",
+ path: "README.md",
+ newContent: "My awesome readme"
+ },
+ {
+ basename: "script.js",
+ path: "js/script.js",
+ newContent: "alert('hi')"
+ },
+ {
+ basename: "vector.svg",
+ path: "img/icons/vector.svg",
+ newContent: "<svg></svg>"
+ },
+];
+
+function* selectFile(projecteditor, resource) {
+ ok(resource && resource.path, "A valid resource has been passed in for selection " + (resource && resource.path));
+ projecteditor.projectTree.selectResource(resource);
+
+ if (resource.isDir) {
+ return;
+ }
+
+ let [editorActivated] = yield promise.all([
+ onceEditorActivated(projecteditor)
+ ]);
+
+ is(editorActivated, projecteditor.currentEditor, "Editor has been activated for " + resource.path);
+}