Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | "use strict"; |
michael@0 | 5 | |
michael@0 | 6 | function test() { |
michael@0 | 7 | waitForExplicitFinish(); |
michael@0 | 8 | |
michael@0 | 9 | setup((ed, win) => { |
michael@0 | 10 | let doc = win.document.querySelector("iframe").contentWindow.document; |
michael@0 | 11 | |
michael@0 | 12 | // trailingspace.js |
michael@0 | 13 | ed.setText("Hello "); |
michael@0 | 14 | ed.setOption("showTrailingSpace", false); |
michael@0 | 15 | ok(!doc.querySelector(".cm-trailingspace")); |
michael@0 | 16 | ed.setOption("showTrailingSpace", true); |
michael@0 | 17 | ok(doc.querySelector(".cm-trailingspace")); |
michael@0 | 18 | |
michael@0 | 19 | // foldcode.js and foldgutter.js |
michael@0 | 20 | ed.setMode(Editor.modes.js); |
michael@0 | 21 | ed.setText("function main() {\nreturn 'Hello, World!';\n}"); |
michael@0 | 22 | executeSoon(() => testFold(doc, ed, win)); |
michael@0 | 23 | }); |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | function testFold(doc, ed, win) { |
michael@0 | 27 | // Wait until folding arrow is there. |
michael@0 | 28 | if (!doc.querySelector(".CodeMirror-foldgutter-open")) { |
michael@0 | 29 | executeSoon(() => testFold(doc, ed, win)); |
michael@0 | 30 | return; |
michael@0 | 31 | } |
michael@0 | 32 | |
michael@0 | 33 | teardown(ed, win); |
michael@0 | 34 | } |