browser/devtools/sourceeditor/test/browser_editor_addons.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 "use strict";
     6 function test() {
     7   waitForExplicitFinish();
     9   setup((ed, win) => {
    10     let doc = win.document.querySelector("iframe").contentWindow.document;
    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"));
    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 }
    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   }
    33   teardown(ed, win);
    34 }

mercurial