Thu, 22 Jan 2015 13:21:57 +0100
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 /* ***** 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 }