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 /* ***** BEGIN LICENSE BLOCK *****
3 * Any copyright is dedicated to the Public Domain.
4 * http://creativecommons.org/publicdomain/zero/1.0/
5 *
6 * Contributor(s):
7 * Julian Viereck <jviereck@mozilla.com>
8 * Patrick Walton <pcwalton@mozilla.com>
9 * Mihai Șucan <mihai.sucan@gmail.com>
10 *
11 * ***** END LICENSE BLOCK ***** */
13 // Tests that, when the user types an extraneous closing bracket, no error
14 // appears.
16 function test() {
17 addTab("data:text/html;charset=utf-8,test for bug 592442");
18 browser.addEventListener("load", function onLoad() {
19 browser.removeEventListener("load", onLoad, true);
20 openConsole(null, testExtraneousClosingBrackets);
21 }, true);
22 }
24 function testExtraneousClosingBrackets(hud) {
25 let jsterm = hud.jsterm;
27 jsterm.setInputValue("document.getElementById)");
29 let error = false;
30 try {
31 jsterm.complete(jsterm.COMPLETE_HINT_ONLY);
32 }
33 catch (ex) {
34 error = true;
35 }
37 ok(!error, "no error was thrown when an extraneous bracket was inserted");
39 finishTest();
40 }