browser/devtools/sourceeditor/test/browser_editor_addons.js

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:6f99bf93059a
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 "use strict";
5
6 function test() {
7 waitForExplicitFinish();
8
9 setup((ed, win) => {
10 let doc = win.document.querySelector("iframe").contentWindow.document;
11
12 // trailingspace.js
13 ed.setText("Hello ");
14 ed.setOption("showTrailingSpace", false);
15 ok(!doc.querySelector(".cm-trailingspace"));
16 ed.setOption("showTrailingSpace", true);
17 ok(doc.querySelector(".cm-trailingspace"));
18
19 // foldcode.js and foldgutter.js
20 ed.setMode(Editor.modes.js);
21 ed.setText("function main() {\nreturn 'Hello, World!';\n}");
22 executeSoon(() => testFold(doc, ed, win));
23 });
24 }
25
26 function testFold(doc, ed, win) {
27 // Wait until folding arrow is there.
28 if (!doc.querySelector(".CodeMirror-foldgutter-open")) {
29 executeSoon(() => testFold(doc, ed, win));
30 return;
31 }
32
33 teardown(ed, win);
34 }

mercurial