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