|
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 } |