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.
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 }