browser/devtools/webconsole/test/browser_webconsole_chrome.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.

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

mercurial