Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 | } |