| 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 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/. */ |
| 5 | |
| 6 | /* |
| 7 | * Date: 23 May 2001 |
| 8 | * |
| 9 | * SUMMARY: Regression test for Bugzilla bug 82306 |
| 10 | * See http://bugzilla.mozilla.org/show_bug.cgi?id=82306 |
| 11 | * |
| 12 | * This test used to crash the JS engine. This was discovered |
| 13 | * by Mike Epstein <[email protected]> |
| 14 | */ |
| 15 | //----------------------------------------------------------------------------- |
| 16 | var gTestfile = 'regress-82306.js'; |
| 17 | var BUGNUMBER = 82306; |
| 18 | var summary = "Testing we don't crash on encodeURI()"; |
| 19 | var URI = ''; |
| 20 | |
| 21 | |
| 22 | //----------------------------------------------------------------------------- |
| 23 | test(); |
| 24 | //----------------------------------------------------------------------------- |
| 25 | |
| 26 | |
| 27 | function test() |
| 28 | { |
| 29 | enterFunc ('test'); |
| 30 | printBugNumber(BUGNUMBER); |
| 31 | printStatus (summary); |
| 32 | |
| 33 | URI += '<?xml version="1.0"?>'; |
| 34 | URI += '<zcti application="xxxx_demo">'; |
| 35 | URI += '<pstn_data>'; |
| 36 | URI += '<ani>650-930-xxxx</ani>'; |
| 37 | URI += '<dnis>877-485-xxxx</dnis>'; |
| 38 | URI += '</pstn_data>'; |
| 39 | URI += '<keyvalue key="name" value="xxx"/>'; |
| 40 | URI += '<keyvalue key="phone" value="6509309000"/>'; |
| 41 | URI += '</zcti>'; |
| 42 | |
| 43 | // Just testing that we don't crash on this |
| 44 | encodeURI(URI); |
| 45 | |
| 46 | reportCompare('No Crash', 'No Crash', ''); |
| 47 | |
| 48 | exitFunc ('test'); |
| 49 | } |