browser/devtools/sourceeditor/test/browser_editor_addons.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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