browser/devtools/webconsole/test/browser_webconsole_chrome.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* vim:set ts=2 sw=2 sts=2 et: */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 // Tests that code completion works properly in chrome tabs, like about:credits.
     8 function test() {
     9   Task.spawn(function*() {
    10     const {tab} = yield loadTab("about:config");
    11     ok(tab, "tab loaded");
    13     const hud = yield openConsole(tab);
    14     ok(hud, "we have a console");
    15     ok(hud.iframeWindow, "we have the console UI window");
    17     let jsterm = hud.jsterm;
    18     ok(jsterm, "we have a jsterm");
    20     let input = jsterm.inputNode;
    21     ok(hud.outputNode, "we have an output node");
    23     // Test typing 'docu'.
    24     input.value = "docu";
    25     input.setSelectionRange(4, 4);
    27     let deferred = promise.defer();
    29     jsterm.complete(jsterm.COMPLETE_HINT_ONLY, function() {
    30       is(jsterm.completeNode.value, "    ment", "'docu' completion");
    31       deferred.resolve(null);
    32     });
    34     yield deferred.promise;
    35   }).then(finishTest);
    36 }

mercurial