michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: "use strict"; michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: setup((ed, win) => { michael@0: let doc = win.document.querySelector("iframe").contentWindow.document; michael@0: michael@0: // trailingspace.js michael@0: ed.setText("Hello "); michael@0: ed.setOption("showTrailingSpace", false); michael@0: ok(!doc.querySelector(".cm-trailingspace")); michael@0: ed.setOption("showTrailingSpace", true); michael@0: ok(doc.querySelector(".cm-trailingspace")); michael@0: michael@0: // foldcode.js and foldgutter.js michael@0: ed.setMode(Editor.modes.js); michael@0: ed.setText("function main() {\nreturn 'Hello, World!';\n}"); michael@0: executeSoon(() => testFold(doc, ed, win)); michael@0: }); michael@0: } michael@0: michael@0: function testFold(doc, ed, win) { michael@0: // Wait until folding arrow is there. michael@0: if (!doc.querySelector(".CodeMirror-foldgutter-open")) { michael@0: executeSoon(() => testFold(doc, ed, win)); michael@0: return; michael@0: } michael@0: michael@0: teardown(ed, win); michael@0: }